From 3534b428629be185e096be99e3bd5fdfe32d5544 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 18 Sep 2014 18:55:44 +0000 Subject: initial commit with rc for skalibs-2.0.0.0 --- src/sysdeps/tryppoll.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/sysdeps/tryppoll.c (limited to 'src/sysdeps/tryppoll.c') diff --git a/src/sysdeps/tryppoll.c b/src/sysdeps/tryppoll.c new file mode 100644 index 0000000..33380b8 --- /dev/null +++ b/src/sysdeps/tryppoll.c @@ -0,0 +1,18 @@ +/* ISC license. */ + +#define _GNU_SOURCE +#include +#include +#include +#include + +int main (void) +{ + struct pollfd x = { .events = POLLIN } ; + struct timespec ts = { .tv_sec = 0, .tv_nsec = 10 } ; + x.fd = open("src/sysdeps/tryppoll.c", O_RDONLY); + if (x.fd < 0) return 111 ; + if (ppoll(&x, 1, &ts, 0) < 0) return 1 ; + if (x.revents != POLLIN) return 1 ; + return 0 ; +} -- cgit v1.2.3