--- IO-AIO/AIO.xs 2012/12/29 09:35:39 1.225 +++ IO-AIO/AIO.xs 2014/04/11 05:19:40 1.229 @@ -21,7 +21,11 @@ # include #endif -#if __linux__ +/* the incompetent fool that created musl keeps __linux__, refuses + * to implement any linux standard apis, and also has no way to test + * for his broken iplementation. on't complain if this fails for you. + */ +#if __linux__ && (defined __GLIBC__ || defined __UCLIBC__) # include # ifdef FS_IOC_FIEMAP # include @@ -200,7 +204,7 @@ goto done; /* else we have to loop - - * it would be tempting (atcually I tried that first) to just query the + * it would be tempting (actually I tried that first) to just query the * number of extents needed, but linux often feels like not returning all * extents, without telling us it left any out. this complicates * this quite a bit. @@ -223,6 +227,9 @@ if (ioctl (req->int1, FS_IOC_FIEMAP, incmap) < 0) return; + if (!incmap->fm_mapped_extents) + goto done; + count = fiemap->fm_mapped_extents + incmap->fm_mapped_extents; fiemap = realloc (fiemap, sizeof (*fiemap) + sizeof (struct fiemap_extent) * count); errno = ENOMEM; @@ -1615,7 +1622,10 @@ req->type = EIO_GROUP; + PUTBACK; req_submit (req); + SPAGAIN; + XPUSHs (req_sv (req, aio_grp_stash)); } @@ -1869,6 +1879,22 @@ OUTPUT: RETVAL +int +pipesize (aio_rfd rfh, int new_size = -1) + PROTOTYPE: $;$ + CODE: +#if defined(F_SETPIPE_SZ) && defined(F_GETPIPE_SZ) + if (new_size >= 0) + RETVAL = fcntl (rfh, F_SETPIPE_SZ, new_size); + else + RETVAL = fcntl (rfh, F_GETPIPE_SZ); +#else + errno = ENOSYS; + RETVAL = -1; +#endif + OUTPUT: + RETVAL + void _on_next_submit (SV *cb) CODE: SvREFCNT_dec (on_next_submit);