--- IO-AIO/AIO.xs 2016/07/18 07:48:01 1.243 +++ IO-AIO/AIO.xs 2017/06/23 03:23:19 1.245 @@ -1098,6 +1098,10 @@ const_eio (FALLOC_FL_COLLAPSE_RANGE) const_eio (FALLOC_FL_ZERO_RANGE) + const_eio (RENAME_NOREPLACE) + const_eio (RENAME_EXCHANGE) + const_eio (RENAME_WHITEOUT) + const_eio (READDIR_DENTS) const_eio (READDIR_DIRS_FIRST) const_eio (READDIR_STAT_ORDER) @@ -1593,6 +1597,22 @@ } void +aio_rename2 (SV8 *oldpath, SV8 *newpath, int flags = 0, SV *callback = &PL_sv_undef) + PPCODE: +{ + eio_wd wd2 = 0; + dREQ; + + req->type = EIO_RENAME; + req_set_path1 (req, oldpath); + req_set_path (req, newpath, &req->sv2, &req->sv4, &wd2, &req->ptr2); + req->int2 = flags; + req->int3 = (long)wd2; + + REQ_SEND; +} + +void aio_mknod (SV8 *pathname, int mode, UV dev, SV *callback = &PL_sv_undef) PPCODE: { @@ -1607,7 +1627,7 @@ } void -aio_mtouch (SV8 *data, IV offset = 0, SV *length = &PL_sv_undef, int flags = 0, SV *callback = &PL_sv_undef) +aio_mtouch (SV8 *data, IV offset = 0, SV *length = &PL_sv_undef, int flags = -1, SV *callback = &PL_sv_undef) ALIAS: aio_mtouch = EIO_MTOUCH aio_msync = EIO_MSYNC @@ -1617,6 +1637,9 @@ char *svptr = SvPVbyte (data, svlen); UV len = SvUV (length); + if (flags < 0) + flags = ix == EIO_MSYNC ? EIO_MS_SYNC : 0; + if (offset < 0) offset += svlen;