… | |
… | |
30 | #undef opendir |
30 | #undef opendir |
31 | #undef closedir |
31 | #undef closedir |
32 | |
32 | |
33 | #ifdef _WIN32 |
33 | #ifdef _WIN32 |
34 | |
34 | |
35 | #define EIO_STRUCT_DIRENT Direntry_t |
35 | // perl overrides all those nice libc functions |
|
|
36 | |
36 | #undef malloc |
37 | #undef malloc |
37 | #undef free |
38 | #undef free |
38 | |
|
|
39 | // perl overrides all those nice libc functions |
|
|
40 | #undef open |
39 | #undef open |
41 | #undef read |
40 | #undef read |
42 | #undef write |
41 | #undef write |
43 | #undef send |
42 | #undef send |
44 | #undef recv |
43 | #undef recv |
… | |
… | |
710 | |
709 | |
711 | poll_wait (); |
710 | poll_wait (); |
712 | } |
711 | } |
713 | } |
712 | } |
714 | |
713 | |
715 | static void atfork_child (void) |
714 | static void ecb_cold |
|
|
715 | reinit (void) |
716 | { |
716 | { |
717 | create_respipe (); |
717 | create_respipe (); |
|
|
718 | |
|
|
719 | if (eio_init (want_poll, done_poll) < 0) |
|
|
720 | croak ("IO::AIO: unable to initialise eio library"); |
718 | } |
721 | } |
719 | |
722 | |
720 | /*****************************************************************************/ |
723 | /*****************************************************************************/ |
721 | |
724 | |
722 | #if !_POSIX_MAPPED_FILES |
725 | #if !_POSIX_MAPPED_FILES |
… | |
… | |
915 | |
918 | |
916 | aio_stash = gv_stashpv ("IO::AIO" , 1); |
919 | aio_stash = gv_stashpv ("IO::AIO" , 1); |
917 | aio_req_stash = gv_stashpv ("IO::AIO::REQ", 1); |
920 | aio_req_stash = gv_stashpv ("IO::AIO::REQ", 1); |
918 | aio_grp_stash = gv_stashpv ("IO::AIO::GRP", 1); |
921 | aio_grp_stash = gv_stashpv ("IO::AIO::GRP", 1); |
919 | |
922 | |
920 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
923 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) |
921 | newCONSTSUB (aio_stash, (char *)civ->name, newSViv (civ->iv)); |
924 | newCONSTSUB (aio_stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
922 | |
925 | |
923 | newCONSTSUB (aio_stash, "PAGESIZE", newSViv (PAGESIZE)); |
926 | newCONSTSUB (aio_stash, "PAGESIZE", newSViv (PAGESIZE)); |
924 | |
927 | |
925 | create_respipe (); |
928 | reinit (); |
926 | |
|
|
927 | if (eio_init (want_poll, done_poll) < 0) |
|
|
928 | croak ("IO::AIO: unable to initialise eio library"); |
|
|
929 | |
|
|
930 | /* atfork child called in fifo order, so before eio's handler */ |
|
|
931 | X_THREAD_ATFORK (0, 0, atfork_child); |
|
|
932 | } |
929 | } |
|
|
930 | |
|
|
931 | void |
|
|
932 | reinit () |
|
|
933 | PROTOTYPE: |
933 | |
934 | |
934 | void |
935 | void |
935 | max_poll_reqs (unsigned int nreqs) |
936 | max_poll_reqs (unsigned int nreqs) |
936 | PROTOTYPE: $ |
937 | PROTOTYPE: $ |
937 | CODE: |
938 | CODE: |
… | |
… | |
991 | void |
992 | void |
992 | aio_fsync (SV *fh, SV *callback=&PL_sv_undef) |
993 | aio_fsync (SV *fh, SV *callback=&PL_sv_undef) |
993 | ALIAS: |
994 | ALIAS: |
994 | aio_fsync = EIO_FSYNC |
995 | aio_fsync = EIO_FSYNC |
995 | aio_fdatasync = EIO_FDATASYNC |
996 | aio_fdatasync = EIO_FDATASYNC |
|
|
997 | aio_syncfs = EIO_SYNCFS |
996 | PPCODE: |
998 | PPCODE: |
997 | { |
999 | { |
998 | int fd = s_fileno_croak (fh, 0); |
1000 | int fd = s_fileno_croak (fh, 0); |
999 | dREQ; |
1001 | dREQ; |
1000 | |
1002 | |
… | |
… | |
1587 | CODE: |
1589 | CODE: |
1588 | RETVAL = posix_fadvise (fh, offset, length, advice); |
1590 | RETVAL = posix_fadvise (fh, offset, length, advice); |
1589 | OUTPUT: |
1591 | OUTPUT: |
1590 | RETVAL |
1592 | RETVAL |
1591 | |
1593 | |
1592 | ssize_t |
1594 | IV |
1593 | sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) |
1595 | sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) |
1594 | CODE: |
1596 | CODE: |
1595 | RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); |
1597 | RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); |
1596 | OUTPUT: |
1598 | OUTPUT: |
1597 | RETVAL |
1599 | RETVAL |