All pastes #2068633 Raw Edit

Untitled

public text v1 · immutable
#2068633 ·published 2011-05-24 20:23 UTC
rendered paste body
#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;
}