--- IO-AIO/AIO.xs 2018/07/24 19:32:20 1.261 +++ IO-AIO/AIO.xs 2018/08/14 11:44:52 1.264 @@ -20,6 +20,10 @@ #include #include +#if HAVE_SYS_SYSMACROS_H +# include +#endif + #if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES # include #endif @@ -109,7 +113,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" @@ -1615,6 +1633,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: