… | |
… | |
65 | # include <signal.h> |
65 | # include <signal.h> |
66 | # define EIO_STRUCT_DIRENT struct dirent |
66 | # define EIO_STRUCT_DIRENT struct dirent |
67 | |
67 | |
68 | #endif |
68 | #endif |
69 | |
69 | |
|
|
70 | /* perl stupidly overrides readdir and maybe others */ |
|
|
71 | /* with thread-unsafe versions, imagine that :( */ |
|
|
72 | #undef readdir |
|
|
73 | #undef opendir |
|
|
74 | #undef closedir |
|
|
75 | |
70 | #define EIO_STRUCT_STAT Stat_t |
76 | #define EIO_STRUCT_STAT Stat_t |
71 | |
77 | |
72 | /* use NV for 32 bit perls as it allows larger offsets */ |
78 | /* use NV for 32 bit perls as it allows larger offsets */ |
73 | #if IVSIZE >= 8 |
79 | #if IVSIZE >= 8 |
74 | # define SvVAL64 SvIV |
80 | # define SvVAL64 SvIV |
… | |
… | |
423 | } |
429 | } |
424 | } |
430 | } |
425 | |
431 | |
426 | static int poll_cb (void) |
432 | static int poll_cb (void) |
427 | { |
433 | { |
428 | int res; |
434 | for (;;) |
429 | |
|
|
430 | do |
|
|
431 | { |
435 | { |
432 | res = eio_poll (); |
436 | int res = eio_poll (); |
433 | |
437 | |
434 | if (res > 0) |
438 | if (res > 0) |
435 | croak (0); |
439 | croak (0); |
|
|
440 | |
|
|
441 | if (!max_outstanding || max_outstanding > eio_nreqs ()) |
|
|
442 | return res; |
|
|
443 | |
|
|
444 | poll_wait (); |
436 | } |
445 | } |
437 | while (max_outstanding && max_outstanding <= eio_nreqs ()); |
|
|
438 | |
|
|
439 | return res; |
|
|
440 | } |
446 | } |
441 | |
447 | |
442 | static void atfork_child (void) |
448 | static void atfork_child (void) |
443 | { |
449 | { |
444 | create_respipe (); |
450 | create_respipe (); |
… | |
… | |
458 | \ |
464 | \ |
459 | req->callback = newSVsv (callback); \ |
465 | req->callback = newSVsv (callback); \ |
460 | req->pri = req_pri |
466 | req->pri = req_pri |
461 | |
467 | |
462 | #define REQ_SEND \ |
468 | #define REQ_SEND \ |
|
|
469 | PUTBACK; \ |
463 | req_submit (req); \ |
470 | req_submit (req); \ |
|
|
471 | SPAGAIN; \ |
464 | \ |
472 | \ |
465 | if (GIMME_V != G_VOID) \ |
473 | if (GIMME_V != G_VOID) \ |
466 | XPUSHs (req_sv (req, AIO_REQ_KLASS)); |
474 | XPUSHs (req_sv (req, AIO_REQ_KLASS)); |
467 | |
475 | |
468 | MODULE = IO::AIO PACKAGE = IO::AIO |
476 | MODULE = IO::AIO PACKAGE = IO::AIO |