Miscellany
public text v1 · immutable#include <stdio.h>
#include <poll.h>
#include <fcntl.h>
int main()
{
int ret;
int p[2];
struct pollfd fds[1];
// libvirt uses a non-blocking pipe, but a "normal" pipe
// also shows the same problem
//pipe2(p, O_NONBLOCK);
pipe(p);
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;
}