Lines Matching +full:user +full:- +full:selectable
31 * Tests how select() and poll() behave on the selectable file descriptor
77 int selectable_fd = -1; in main()
95 while ((op = getopt(argc, argv, "i:sptnq")) != -1) { in main()
131 fprintf(stderr, "selpolltest: choose select (-s) or poll (-p), but not both\n"); in main()
135 fprintf(stderr, "selpolltest: timeout (-t) requires select (-s) or poll (-p)\n"); in main()
139 if (pcap_findalldevs(&devlist, ebuf) == -1) in main()
143 device = strdup(devlist->name); in main()
171 if (selectable_fd == -1) { in main()
185 * so we want to force non-blocking mode. in main()
197 if (pcap_setnonblock(pd, 1, ebuf) == -1) in main()
207 if (selectable_fd != -1) { in main()
216 required_timeout->tv_usec < 1000) in main()
217 seltimeout.tv_usec = required_timeout->tv_usec; in main()
227 status = select((selectable_fd == -1) ? in main()
230 if (status == -1) { in main()
250 status = pcap_dispatch(pd, -1, countme, in main()
258 * and we don't want to spam the user with in main()
279 required_timeout->tv_usec >= 1000) in main()
280 polltimeout = (int)(required_timeout->tv_usec/1000); in main()
282 polltimeout = -1; in main()
283 status = poll(&fd, (selectable_fd == -1) ? 0 : 1, polltimeout); in main()
284 if (status == -1) { in main()
312 status = pcap_dispatch(pd, -1, countme, in main()
320 * and we don't want to spam the user with in main()
333 status = pcap_dispatch(pd, -1, countme, in main()
341 if (status == -2) { in main()
350 if (status == -1) { in main()
358 exit(status == -1 ? 1 : 0); in main()
362 countme(u_char *user, const struct pcap_pkthdr *h _U_, const u_char *sp _U_) in countme() argument
364 int *counterp = (int *)user; in countme()
372 (void)fprintf(stderr, "Usage: %s [ -sptnq ] [ -i interface ] [expression]\n", in usage()
389 if (fmt[-1] != '\n') in error()
408 if (fmt[-1] != '\n') in warning()
440 dst[-1] = ' '; in copy_argv()
442 dst[-1] = '\0'; in copy_argv()