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.257 by root, Tue Jul 17 23:20:09 2018 UTC vs.
Revision 1.260 by root, Tue Jul 24 04:58:59 2018 UTC

3#include <errno.h> 3#include <errno.h>
4 4
5#include "EXTERN.h" 5#include "EXTERN.h"
6#include "perl.h" 6#include "perl.h"
7#include "XSUB.h" 7#include "XSUB.h"
8
9#if !defined mg_findext
10# define mg_findext(sv,type,vtbl) mg_find (sv, type)
11#endif
8 12
9#include <stddef.h> 13#include <stddef.h>
10#include <stdlib.h> 14#include <stdlib.h>
11#include <errno.h> 15#include <errno.h>
12#include <sys/types.h> 16#include <sys/types.h>
159# else 163# else
160# define MAP_ANONYMOUS MAP_FIXED /* and hope this fails */ 164# define MAP_ANONYMOUS MAP_FIXED /* and hope this fails */
161# endif 165# endif
162#endif 166#endif
163 167
164/* defines all sorts of constants to 0 unless they are already defined */
165/* also provides const_iv_ and const_niv_ macros for them */
166#include "def0.h"
167
168#ifndef makedev 168#ifndef makedev
169# define makedev(maj,min) (((maj) << 8) | (min)) 169# define makedev(maj,min) (((maj) << 8) | (min))
170#endif 170#endif
171#ifndef major 171#ifndef major
172# define major(dev) ((dev) >> 8) 172# define major(dev) ((dev) >> 8)
180#endif 180#endif
181 181
182/*****************************************************************************/ 182/*****************************************************************************/
183 183
184#if !_POSIX_MAPPED_FILES 184#if !_POSIX_MAPPED_FILES
185# define mmap(addr,length,prot,flags,fd,offs) EIO_ENOSYS () 185# define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, (void *)-1)
186# define munmap(addr,length) EIO_ENOSYS () 186# define munmap(addr,length) EIO_ENOSYS ()
187#endif 187#endif
188 188
189#if !_POSIX_MEMORY_PROTECTION 189#if !_POSIX_MEMORY_PROTECTION
190# define mprotect(addr,len,prot) EIO_ENOSYS () 190# define mprotect(addr,len,prot) EIO_ENOSYS ()
271{ 271{
272 /* todo: iterate over magic and only free ours, but of course */ 272 /* todo: iterate over magic and only free ours, but of course */
273 /* the perl5porters will call that (correct) behaviour buggy */ 273 /* the perl5porters will call that (correct) behaviour buggy */
274 sv_unmagic (sv, FOREIGN_MAGIC); 274 sv_unmagic (sv, FOREIGN_MAGIC);
275} 275}
276
277/*****************************************************************************/
278
279/* defines all sorts of constants to 0 unless they are already defined */
280/* also provides const_iv_ and const_niv_ macros for them */
281#include "def0.h"
276 282
277/*****************************************************************************/ 283/*****************************************************************************/
278 284
279static void 285static void
280fiemap (eio_req *req) 286fiemap (eio_req *req)
1038 const_niv (MADV_RANDOM , POSIX_MADV_RANDOM) 1044 const_niv (MADV_RANDOM , POSIX_MADV_RANDOM)
1039 const_niv (MADV_WILLNEED , POSIX_MADV_WILLNEED) 1045 const_niv (MADV_WILLNEED , POSIX_MADV_WILLNEED)
1040 const_niv (MADV_DONTNEED , POSIX_MADV_DONTNEED) 1046 const_niv (MADV_DONTNEED , POSIX_MADV_DONTNEED)
1041 1047
1042 /* the second block will be 0 when missing */ 1048 /* the second block will be 0 when missing */
1049 const_iv (O_ACCMODE)
1050
1043 const_iv (O_RDONLY) 1051 const_iv (O_RDONLY)
1044 const_iv (O_WRONLY) 1052 const_iv (O_WRONLY)
1045 const_iv (O_RDWR) 1053 const_iv (O_RDWR)
1046 const_iv (O_CREAT) 1054 const_iv (O_CREAT)
1047 const_iv (O_TRUNC) 1055 const_iv (O_TRUNC)
2065munmap (SV *scalar) 2073munmap (SV *scalar)
2066 CODE: 2074 CODE:
2067 sv_clear_foreign (scalar); 2075 sv_clear_foreign (scalar);
2068 2076
2069SV * 2077SV *
2070mremap (SV *scalar, STRLEN new_length, int flags = 0, IV new_address = 0) 2078mremap (SV *scalar, STRLEN new_length, int flags = MREMAP_MAYMOVE, IV new_address = 0)
2071 CODE: 2079 CODE:
2072{ 2080{
2073 MAGIC *mg = mg_findext (scalar, FOREIGN_MAGIC, &mmap_vtbl); 2081 MAGIC *mg = mg_findext (scalar, FOREIGN_MAGIC, &mmap_vtbl);
2074 void *new; 2082 void *new;
2075 2083

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines