5 FILE* f
= popen("/bin/bash -c 'for i in 1 2 3; do { echo $i; sleep 1; }; done'", "r");
12 pfd
.events
= POLLIN
| POLLRDBAND
;
17 int rv
= poll(&pfd
, 1, 500);
18 printf("rv=%d\n", rv
);
23 printf("events=%08x revents=%08x\n", pfd
.events
, pfd
.revents
);
24 if ((pfd
.events
& pfd
.revents
) == 0)
28 printf("output: %s", buffer
);