… | |
… | |
19 | |
19 | |
20 | #if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES |
20 | #if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES |
21 | # include <sys/mman.h> |
21 | # include <sys/mman.h> |
22 | #endif |
22 | #endif |
23 | |
23 | |
24 | #if __linux__ |
24 | /* the incompetent fool that created musl keeps __linux__, refuses |
|
|
25 | * to implement any linux standard apis, and also has no way to test |
|
|
26 | * for his broken iplementation. on't complain if this fails for you. |
|
|
27 | */ |
|
|
28 | #if __linux__ && (defined __GLIBC__ || defined __UCLIBC__) |
25 | # include <linux/fs.h> |
29 | # include <linux/fs.h> |
26 | # ifdef FS_IOC_FIEMAP |
30 | # ifdef FS_IOC_FIEMAP |
27 | # include <linux/types.h> |
31 | # include <linux/types.h> |
28 | # include <linux/fiemap.h> |
32 | # include <linux/fiemap.h> |
29 | # define HAVE_FIEMAP 1 |
33 | # define HAVE_FIEMAP 1 |
… | |
… | |
1260 | len = svlen - dataoffset; |
1264 | len = svlen - dataoffset; |
1261 | } |
1265 | } |
1262 | else |
1266 | else |
1263 | { |
1267 | { |
1264 | /* read: check type and grow scalar as necessary */ |
1268 | /* read: check type and grow scalar as necessary */ |
1265 | SvUPGRADE (data, SVt_PV); |
|
|
1266 | if (SvLEN (data) >= SvCUR (data)) |
1269 | if (!SvPOK (data) || SvLEN (data) >= SvCUR (data)) |
1267 | svptr = SvGROW (data, len + dataoffset + 1); |
1270 | svptr = sv_grow (data, len + dataoffset + 1); |
1268 | else if (SvCUR (data) < len + dataoffset) |
1271 | else if (SvCUR (data) < len + dataoffset) |
1269 | croak ("length + dataoffset outside of scalar, and cannot grow"); |
1272 | croak ("length + dataoffset outside of scalar, and cannot grow"); |
1270 | } |
1273 | } |
1271 | |
1274 | |
1272 | { |
1275 | { |
… | |
… | |
1616 | { |
1619 | { |
1617 | dREQ; |
1620 | dREQ; |
1618 | |
1621 | |
1619 | req->type = EIO_GROUP; |
1622 | req->type = EIO_GROUP; |
1620 | |
1623 | |
|
|
1624 | PUTBACK; |
1621 | req_submit (req); |
1625 | req_submit (req); |
|
|
1626 | SPAGAIN; |
|
|
1627 | |
1622 | XPUSHs (req_sv (req, aio_grp_stash)); |
1628 | XPUSHs (req_sv (req, aio_grp_stash)); |
1623 | } |
1629 | } |
1624 | |
1630 | |
1625 | void |
1631 | void |
1626 | aio_nop (SV *callback=&PL_sv_undef) |
1632 | aio_nop (SV *callback=&PL_sv_undef) |