#define _GNU_SOURCE #include #include #include #include #include #include #include #define BUF_SIZE 256 int main(int argc, char **argv) { int i, pipefd[2], result; for (i = 0; i < 1000; i++) { fprintf(stderr, "%d\n", i); result = pipe2(pipefd, O_NOTIFICATION_PIPE); if (result < 0) { fprintf(stderr, "Failed to create pipe2(2): %s\n", strerror(errno)); return errno; } result = ioctl(pipefd[0], IOC_WATCH_QUEUE_SET_SIZE, BUF_SIZE); if (result < 0) { fprintf(stderr, "Failed to set watch_queue size: %s\n", strerror(errno)); return errno; } close(pipefd[0]); close(pipefd[1]); } return 0; }