From 8be7dacbb351237aba5cad021ffe1298a4e3c1c8 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 26 Aug 2009 17:31:20 +0000 Subject: *** empty log message *** --- ev.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'ev.c') diff --git a/ev.c b/ev.c index 1161aa3..2403b32 100644 --- a/ev.c +++ b/ev.c @@ -304,7 +304,7 @@ extern "C" { #endif #ifndef EV_USE_SIGNALFD -# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9)) +# if __linux && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)) # define EV_USE_SIGNALFD 1 # else # define EV_USE_SIGNALFD 0 @@ -404,9 +404,34 @@ int eventfd (unsigned int initval, int flags); #endif #if EV_USE_SIGNALFD -# include +/* our minimum requirement is glibc 2.7 which has the stub, but not the header */ +# include +# ifndef SFD_NONBLOCK +# define SFD_NONBLOCK O_NONBLOCK +# endif +# ifndef SFD_CLOEXEC +# ifdef O_CLOEXEC +# define SFD_CLOEXEC O_CLOEXEC +# else +# define SFD_CLOEXEC 02000000 +# endif +# endif +# ifdef __cplusplus +extern "C" { +# endif +int signalfd (int fd, const sigset_t *mask, int flags); + +struct signalfd_siginfo +{ + uint32_t ssi_signo; + char pad[128 - sizeof (uint32_t)]; +}; +# ifdef __cplusplus +} +# endif #endif + /**/ #if EV_VERIFY >= 3 -- cgit v1.2.3