#include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { char *indev; int inpipe; char buf[100]; int i; if (argc < 2) errx(1, "Usage: %s []", argv[0]); indev = argv[1]; if ((inpipe = open(indev, O_RDONLY)) < 0) err(1, "%s: open", indev); i = 1; if (argc > 2) i = atoi(argv[2]); if (ioctl(inpipe, USB_SET_TIMEOUT, &i) < 0) err(1, "USB_SET_TIMEOUT"); ualarm(50100, 0); if (read(inpipe, buf, sizeof(buf)) < 0) err(1, "%s: read", indev); }