--- IO-AIO/AIO.xs 2018/01/06 02:11:10 1.252 +++ IO-AIO/AIO.xs 2018/02/20 04:32:59 1.253 @@ -108,6 +108,10 @@ #include "libeio/config.h" +#if HAVE_EVENTFD +# include +#endif + #if HAVE_RLIMITS #include #include @@ -1163,6 +1167,10 @@ const_iv (SPLICE_F_MORE) const_iv (SPLICE_F_GIFT) + const_iv (EFD_CLOEXEC) + const_iv (EFD_NONBLOCK) + const_iv (EFD_SEMAPHORE) + /* these are libeio constants, and are independent of gendef0 */ const_eio (SEEK_SET) const_eio (SEEK_CUR) @@ -2158,6 +2166,20 @@ } } +void +eventfd (unsigned int initval = 0, int flags = 0) + PPCODE: +{ + int fd; +#if HAVE_EVENTFD + fd = eventfd (initval, flags); +#else + fd = (errno = ENOSYS, -1); +#endif + + XPUSHs (newmortalFH (fd, O_RDWR)); +} + UV get_fdlimit () CODE: