--- IO-AIO/AIO.xs 2018/07/24 04:58:59 1.260 +++ IO-AIO/AIO.xs 2018/08/14 11:50:43 1.265 @@ -14,11 +14,18 @@ #include #include #include +#include #include #include #include #include +#if HAVE_SYS_MKDEV_H +# include +#elif HAVE_SYS_SYSMACROS_H +# include +#endif + #if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES # include #endif @@ -108,7 +115,21 @@ /*****************************************************************************/ -#include "libeio/config.h" +#include "config.h" + +#if HAVE_ST_XTIMENSEC +# define ATIMENSEC PL_statcache.st_atimensec +# define MTIMENSEC PL_statcache.st_mtimensec +# define CTIMENSEC PL_statcache.st_ctimensec +#elif HAVE_ST_XTIMESPEC +# define ATIMENSEC PL_statcache.st_atim.tv_nsec +# define MTIMENSEC PL_statcache.st_mtim.tv_nsec +# define CTIMENSEC PL_statcache.st_ctim.tv_nsec +#else +# define ATIMENSEC 0 +# define MTIMENSEC 0 +# define CTIMENSEC 0 +#endif #include "schmorp.h" @@ -1122,6 +1143,9 @@ const_iv (F_DUPFD_CLOEXEC) + const_iv (MSG_CMSG_CLOEXEC) + const_iv (SOCK_CLOEXEC) + const_iv (F_OFD_GETLK) const_iv (F_OFD_SETLK) const_iv (F_OFD_GETLKW) @@ -1611,6 +1635,32 @@ REQ_SEND; } +void +st_xtime () + ALIAS: + st_atime = 1 + st_mtime = 2 + st_ctime = 4 + st_xtime = 7 + PPCODE: + EXTEND (SP, 3); + if (ix & 1) PUSHs (newSVnv (PL_statcache.st_atime + 1e-9 * ATIMENSEC)); + if (ix & 2) PUSHs (newSVnv (PL_statcache.st_mtime + 1e-9 * MTIMENSEC)); + if (ix & 4) PUSHs (newSVnv (PL_statcache.st_ctime + 1e-9 * CTIMENSEC)); + +void +st_xtimensec () + ALIAS: + st_atimensec = 1 + st_mtimensec = 2 + st_ctimensec = 4 + st_xtimensec = 7 + PPCODE: + EXTEND (SP, 3); + if (ix & 1) PUSHs (newSViv (ATIMENSEC)); + if (ix & 2) PUSHs (newSViv (MTIMENSEC)); + if (ix & 4) PUSHs (newSViv (CTIMENSEC)); + UV major (UV dev) ALIAS: