39 #include <sys/ioctl.h> 41 #include <linux/usbdevice_fs.h> 44 int main(
int argc,
char **argv)
51 fprintf(stderr,
"Usage: usbreset device-filename\n");
56 fd = open(filename, O_WRONLY);
58 perror(
"Error opening output file");
62 printf(
"Resetting USB device %s\n", filename);
63 rc = ioctl(fd, USBDEVFS_RESET, 0);
65 perror(
"Error in ioctl");
68 printf(
"Reset successful\n");
int main(int argc, char **argv)