ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.260 by root, Tue Jul 24 04:58:59 2018 UTC vs.
Revision 1.264 by root, Tue Aug 14 11:44:52 2018 UTC

12 12
13#include <stddef.h> 13#include <stddef.h>
14#include <stdlib.h> 14#include <stdlib.h>
15#include <errno.h> 15#include <errno.h>
16#include <sys/types.h> 16#include <sys/types.h>
17#include <sys/socket.h>
17#include <sys/stat.h> 18#include <sys/stat.h>
18#include <limits.h> 19#include <limits.h>
19#include <fcntl.h> 20#include <fcntl.h>
20#include <sched.h> 21#include <sched.h>
22
23#if HAVE_SYS_SYSMACROS_H
24# include <sys/sysmacros.h>
25#endif
21 26
22#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES 27#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
23# include <sys/mman.h> 28# include <sys/mman.h>
24#endif 29#endif
25 30
106#define expect_false(expr) expect ((expr) != 0, 0) 111#define expect_false(expr) expect ((expr) != 0, 0)
107#define expect_true(expr) expect ((expr) != 0, 1) 112#define expect_true(expr) expect ((expr) != 0, 1)
108 113
109/*****************************************************************************/ 114/*****************************************************************************/
110 115
111#include "libeio/config.h" 116#include "config.h"
117
118#if HAVE_ST_XTIMENSEC
119# define ATIMENSEC PL_statcache.st_atimensec
120# define MTIMENSEC PL_statcache.st_mtimensec
121# define CTIMENSEC PL_statcache.st_ctimensec
122#elif HAVE_ST_XTIMESPEC
123# define ATIMENSEC PL_statcache.st_atim.tv_nsec
124# define MTIMENSEC PL_statcache.st_mtim.tv_nsec
125# define CTIMENSEC PL_statcache.st_ctim.tv_nsec
126#else
127# define ATIMENSEC 0
128# define MTIMENSEC 0
129# define CTIMENSEC 0
130#endif
112 131
113#include "schmorp.h" 132#include "schmorp.h"
114 133
115#if HAVE_EVENTFD 134#if HAVE_EVENTFD
116# include <sys/eventfd.h> 135# include <sys/eventfd.h>
1119 1138
1120 const_iv (MREMAP_MAYMOVE) 1139 const_iv (MREMAP_MAYMOVE)
1121 const_iv (MREMAP_FIXED) 1140 const_iv (MREMAP_FIXED)
1122 1141
1123 const_iv (F_DUPFD_CLOEXEC) 1142 const_iv (F_DUPFD_CLOEXEC)
1143
1144 const_iv (MSG_CMSG_CLOEXEC)
1145 const_iv (SOCK_CLOEXEC)
1124 1146
1125 const_iv (F_OFD_GETLK) 1147 const_iv (F_OFD_GETLK)
1126 const_iv (F_OFD_SETLK) 1148 const_iv (F_OFD_SETLK)
1127 const_iv (F_OFD_GETLKW) 1149 const_iv (F_OFD_GETLKW)
1128 1150
1609 req_set_fh_or_path (req, ix, ix == EIO_STATVFS ? EIO_FSTATVFS : EIO_FSTAT, fh_or_path); 1631 req_set_fh_or_path (req, ix, ix == EIO_STATVFS ? EIO_FSTATVFS : EIO_FSTAT, fh_or_path);
1610 1632
1611 REQ_SEND; 1633 REQ_SEND;
1612} 1634}
1613 1635
1636void
1637st_xtime ()
1638 ALIAS:
1639 st_atime = 1
1640 st_mtime = 2
1641 st_ctime = 4
1642 st_xtime = 7
1643 PPCODE:
1644 EXTEND (SP, 3);
1645 if (ix & 1) PUSHs (newSVnv (PL_statcache.st_atime + 1e-9 * ATIMENSEC));
1646 if (ix & 2) PUSHs (newSVnv (PL_statcache.st_mtime + 1e-9 * MTIMENSEC));
1647 if (ix & 4) PUSHs (newSVnv (PL_statcache.st_ctime + 1e-9 * CTIMENSEC));
1648
1649void
1650st_xtimensec ()
1651 ALIAS:
1652 st_atimensec = 1
1653 st_mtimensec = 2
1654 st_ctimensec = 4
1655 st_xtimensec = 7
1656 PPCODE:
1657 EXTEND (SP, 3);
1658 if (ix & 1) PUSHs (newSViv (ATIMENSEC));
1659 if (ix & 2) PUSHs (newSViv (MTIMENSEC));
1660 if (ix & 4) PUSHs (newSViv (CTIMENSEC));
1661
1614UV 1662UV
1615major (UV dev) 1663major (UV dev)
1616 ALIAS: 1664 ALIAS:
1617 minor = 1 1665 minor = 1
1618 CODE: 1666 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines