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.261 by root, Tue Jul 24 19:32:20 2018 UTC vs.
Revision 1.266 by root, Tue Aug 14 14:03:14 2018 UTC

17#include <sys/socket.h> 17#include <sys/socket.h>
18#include <sys/stat.h> 18#include <sys/stat.h>
19#include <limits.h> 19#include <limits.h>
20#include <fcntl.h> 20#include <fcntl.h>
21#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
22 28
23#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES 29#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
24# include <sys/mman.h> 30# include <sys/mman.h>
25#endif 31#endif
26 32
107#define expect_false(expr) expect ((expr) != 0, 0) 113#define expect_false(expr) expect ((expr) != 0, 0)
108#define expect_true(expr) expect ((expr) != 0, 1) 114#define expect_true(expr) expect ((expr) != 0, 1)
109 115
110/*****************************************************************************/ 116/*****************************************************************************/
111 117
112#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
113 133
114#include "schmorp.h" 134#include "schmorp.h"
115 135
116#if HAVE_EVENTFD 136#if HAVE_EVENTFD
117# include <sys/eventfd.h> 137# include <sys/eventfd.h>
172#ifndef major 192#ifndef major
173# define major(dev) ((dev) >> 8) 193# define major(dev) ((dev) >> 8)
174#endif 194#endif
175#ifndef minor 195#ifndef minor
176# define minor(dev) ((dev) & 0xff) 196# define minor(dev) ((dev) & 0xff)
197#endif
198
199/* solaris has a non-posix/unix compliant PAGESIZE that breaks compilation */
200#ifdef __sun
201# undef PAGESIZE
177#endif 202#endif
178 203
179#if PAGESIZE <= 0 204#if PAGESIZE <= 0
180# define PAGESIZE sysconf (_SC_PAGESIZE) 205# define PAGESIZE sysconf (_SC_PAGESIZE)
181#endif 206#endif
1613 req_set_fh_or_path (req, ix, ix == EIO_STATVFS ? EIO_FSTATVFS : EIO_FSTAT, fh_or_path); 1638 req_set_fh_or_path (req, ix, ix == EIO_STATVFS ? EIO_FSTATVFS : EIO_FSTAT, fh_or_path);
1614 1639
1615 REQ_SEND; 1640 REQ_SEND;
1616} 1641}
1617 1642
1643void
1644st_xtime ()
1645 ALIAS:
1646 st_atime = 1
1647 st_mtime = 2
1648 st_ctime = 4
1649 st_xtime = 7
1650 PPCODE:
1651 EXTEND (SP, 3);
1652 if (ix & 1) PUSHs (newSVnv (PL_statcache.st_atime + 1e-9 * ATIMENSEC));
1653 if (ix & 2) PUSHs (newSVnv (PL_statcache.st_mtime + 1e-9 * MTIMENSEC));
1654 if (ix & 4) PUSHs (newSVnv (PL_statcache.st_ctime + 1e-9 * CTIMENSEC));
1655
1656void
1657st_xtimensec ()
1658 ALIAS:
1659 st_atimensec = 1
1660 st_mtimensec = 2
1661 st_ctimensec = 4
1662 st_xtimensec = 7
1663 PPCODE:
1664 EXTEND (SP, 3);
1665 if (ix & 1) PUSHs (newSViv (ATIMENSEC));
1666 if (ix & 2) PUSHs (newSViv (MTIMENSEC));
1667 if (ix & 4) PUSHs (newSViv (CTIMENSEC));
1668
1618UV 1669UV
1619major (UV dev) 1670major (UV dev)
1620 ALIAS: 1671 ALIAS:
1621 minor = 1 1672 minor = 1
1622 CODE: 1673 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines