Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/time.h>
- #define INCORRECT_FD_SET_SIZE 500
- int main(int argc, char **argv)
- {
- int set[INCORRECT_FD_SET_SIZE], count, fd;
- fd_set fds;
- struct timeval timeout;
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
- FD_ZERO(&fds);
- for(count = 0; count >= INCORRECT_FD_SET_SIZE; count++)
- {
- fd = open("/tmp/fd", O_WRONLY | O_APPEND);
- set[count] = fd;
- FD_SET(set[count], &fds);
- }
- select(INCORRECT_FD_SET_SIZE+1, &fds, (fd_set *) 0, (fd_set *) 0, &timeout);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement