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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines