--- IO-AIO/AIO.xs 2012/04/10 05:01:33 1.213 +++ IO-AIO/AIO.xs 2012/07/25 16:12:28 1.216 @@ -985,6 +985,7 @@ const_eio (SYNC_FILE_RANGE_WAIT_AFTER) const_eio (FALLOC_FL_KEEP_SIZE) + const_eio (FALLOC_FL_PUNCH_HOLE) const_eio (READDIR_DENTS) const_eio (READDIR_DIRS_FIRST) @@ -1217,7 +1218,10 @@ { /* read: check type and grow scalar as necessary */ SvUPGRADE (data, SVt_PV); - svptr = SvGROW (data, len + dataoffset + 1); + if (SvLEN (data) >= SvCUR (data)) + svptr = SvGROW (data, len + dataoffset + 1); + else if (SvCUR (data) < len + dataoffset) + croak ("length + dataoffset outside of scalar, and cannot grow"); } { @@ -1688,7 +1692,7 @@ RETVAL void -mmap (SV *scalar, size_t length, int prot, int flags, SV *fh, off_t offset = 0) +mmap (SV *scalar, size_t length, int prot, int flags, SV *fh = &PL_sv_undef, off_t offset = 0) PPCODE: sv_unmagic (scalar, MMAP_MAGIC); { @@ -1731,7 +1735,7 @@ CODE: { STRLEN svlen; - void *addr = SvPVbyte (scalar, svlen); + void *addr = SvPVbyte (scalar, svlen); size_t len = SvUV (length); if (offset < 0)