]> granicus.if.org Git - strace/blob - test/select.c
test/select.c: make comment more understandable.
[strace] / test / select.c
1 /* dave@treblig.org */
2 #include <sys/select.h>
3 #include <sys/time.h>
4 #include <sys/types.h>
5 #include <stdlib.h>
6 #include <string.h>
7 #include <unistd.h>
8
9 char buffer[1024*1024*2];
10
11 int main()
12 {
13         fd_set rds;
14         FD_ZERO(&rds);
15         FD_SET(2, &rds);
16         /* Start with a nice simple select */
17         select(3, &rds, &rds, &rds, NULL);
18         /* Now the crash case that trinity found, negative nfds
19          * but with a pointer to a large chunk of valid memory.
20          */
21         select(-1, (fd_set *)buffer, NULL, NULL, NULL);
22         return 0;
23 }