--- IO-AIO/AIO.xs 2018/07/18 00:57:55 1.258 +++ IO-AIO/AIO.xs 2018/07/24 04:58:59 1.260 @@ -165,10 +165,6 @@ # endif #endif -/* defines all sorts of constants to 0 unless they are already defined */ -/* also provides const_iv_ and const_niv_ macros for them */ -#include "def0.h" - #ifndef makedev # define makedev(maj,min) (((maj) << 8) | (min)) #endif @@ -186,7 +182,7 @@ /*****************************************************************************/ #if !_POSIX_MAPPED_FILES -# define mmap(addr,length,prot,flags,fd,offs) EIO_ENOSYS () +# define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, (void *)-1) # define munmap(addr,length) EIO_ENOSYS () #endif @@ -280,6 +276,12 @@ /*****************************************************************************/ +/* defines all sorts of constants to 0 unless they are already defined */ +/* also provides const_iv_ and const_niv_ macros for them */ +#include "def0.h" + +/*****************************************************************************/ + static void fiemap (eio_req *req) { @@ -1044,6 +1046,8 @@ const_niv (MADV_DONTNEED , POSIX_MADV_DONTNEED) /* the second block will be 0 when missing */ + const_iv (O_ACCMODE) + const_iv (O_RDONLY) const_iv (O_WRONLY) const_iv (O_RDWR) @@ -2071,7 +2075,7 @@ sv_clear_foreign (scalar); SV * -mremap (SV *scalar, STRLEN new_length, int flags = 0, IV new_address = 0) +mremap (SV *scalar, STRLEN new_length, int flags = MREMAP_MAYMOVE, IV new_address = 0) CODE: { MAGIC *mg = mg_findext (scalar, FOREIGN_MAGIC, &mmap_vtbl);