Untitled
public text v1 · immutable#include <stdio.h>
#include <poll.h>
#include <fcntl.h>
int main()
{
int ret;
int p[2];
struct pollfd fds[1];
pipe2(p, O_NONBLOCK);
fds[0].fd = p[0];
fds[0].events = POLLIN;
fds[0].revents = 0;
printf("before\n");
ret = poll(fds, 1, -1);
printf("after %d\n", ret);
return 0;
}