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.258 by root, Wed Jul 18 00:57:55 2018 UTC vs.
Revision 1.261 by root, Tue Jul 24 19:32:20 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>
21 22
163# else 164# else
164# define MAP_ANONYMOUS MAP_FIXED /* and hope this fails */ 165# define MAP_ANONYMOUS MAP_FIXED /* and hope this fails */
165# endif 166# endif
166#endif 167#endif
167 168
168/* defines all sorts of constants to 0 unless they are already defined */
169/* also provides const_iv_ and const_niv_ macros for them */
170#include "def0.h"
171
172#ifndef makedev 169#ifndef makedev
173# define makedev(maj,min) (((maj) << 8) | (min)) 170# define makedev(maj,min) (((maj) << 8) | (min))
174#endif 171#endif
175#ifndef major 172#ifndef major
176# define major(dev) ((dev) >> 8) 173# define major(dev) ((dev) >> 8)
184#endif 181#endif
185 182
186/*****************************************************************************/ 183/*****************************************************************************/
187 184
188#if !_POSIX_MAPPED_FILES 185#if !_POSIX_MAPPED_FILES
189# define mmap(addr,length,prot,flags,fd,offs) EIO_ENOSYS () 186# define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, (void *)-1)
190# define munmap(addr,length) EIO_ENOSYS () 187# define munmap(addr,length) EIO_ENOSYS ()
191#endif 188#endif
192 189
193#if !_POSIX_MEMORY_PROTECTION 190#if !_POSIX_MEMORY_PROTECTION
194# define mprotect(addr,len,prot) EIO_ENOSYS () 191# define mprotect(addr,len,prot) EIO_ENOSYS ()
275{ 272{
276 /* todo: iterate over magic and only free ours, but of course */ 273 /* todo: iterate over magic and only free ours, but of course */
277 /* the perl5porters will call that (correct) behaviour buggy */ 274 /* the perl5porters will call that (correct) behaviour buggy */
278 sv_unmagic (sv, FOREIGN_MAGIC); 275 sv_unmagic (sv, FOREIGN_MAGIC);
279} 276}
277
278/*****************************************************************************/
279
280/* defines all sorts of constants to 0 unless they are already defined */
281/* also provides const_iv_ and const_niv_ macros for them */
282#include "def0.h"
280 283
281/*****************************************************************************/ 284/*****************************************************************************/
282 285
283static void 286static void
284fiemap (eio_req *req) 287fiemap (eio_req *req)
1042 const_niv (MADV_RANDOM , POSIX_MADV_RANDOM) 1045 const_niv (MADV_RANDOM , POSIX_MADV_RANDOM)
1043 const_niv (MADV_WILLNEED , POSIX_MADV_WILLNEED) 1046 const_niv (MADV_WILLNEED , POSIX_MADV_WILLNEED)
1044 const_niv (MADV_DONTNEED , POSIX_MADV_DONTNEED) 1047 const_niv (MADV_DONTNEED , POSIX_MADV_DONTNEED)
1045 1048
1046 /* the second block will be 0 when missing */ 1049 /* the second block will be 0 when missing */
1050 const_iv (O_ACCMODE)
1051
1047 const_iv (O_RDONLY) 1052 const_iv (O_RDONLY)
1048 const_iv (O_WRONLY) 1053 const_iv (O_WRONLY)
1049 const_iv (O_RDWR) 1054 const_iv (O_RDWR)
1050 const_iv (O_CREAT) 1055 const_iv (O_CREAT)
1051 const_iv (O_TRUNC) 1056 const_iv (O_TRUNC)
1115 1120
1116 const_iv (MREMAP_MAYMOVE) 1121 const_iv (MREMAP_MAYMOVE)
1117 const_iv (MREMAP_FIXED) 1122 const_iv (MREMAP_FIXED)
1118 1123
1119 const_iv (F_DUPFD_CLOEXEC) 1124 const_iv (F_DUPFD_CLOEXEC)
1125
1126 const_iv (MSG_CMSG_CLOEXEC)
1127 const_iv (SOCK_CLOEXEC)
1120 1128
1121 const_iv (F_OFD_GETLK) 1129 const_iv (F_OFD_GETLK)
1122 const_iv (F_OFD_SETLK) 1130 const_iv (F_OFD_SETLK)
1123 const_iv (F_OFD_GETLKW) 1131 const_iv (F_OFD_GETLKW)
1124 1132
2069munmap (SV *scalar) 2077munmap (SV *scalar)
2070 CODE: 2078 CODE:
2071 sv_clear_foreign (scalar); 2079 sv_clear_foreign (scalar);
2072 2080
2073SV * 2081SV *
2074mremap (SV *scalar, STRLEN new_length, int flags = 0, IV new_address = 0) 2082mremap (SV *scalar, STRLEN new_length, int flags = MREMAP_MAYMOVE, IV new_address = 0)
2075 CODE: 2083 CODE:
2076{ 2084{
2077 MAGIC *mg = mg_findext (scalar, FOREIGN_MAGIC, &mmap_vtbl); 2085 MAGIC *mg = mg_findext (scalar, FOREIGN_MAGIC, &mmap_vtbl);
2078 void *new; 2086 void *new;
2079 2087

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines