… | |
… | |
19 | =cut |
19 | =cut |
20 | |
20 | |
21 | package IO::FDPass; |
21 | package IO::FDPass; |
22 | |
22 | |
23 | BEGIN { |
23 | BEGIN { |
24 | $VERSION = '0.1'; |
24 | $VERSION = 0.2; |
25 | |
25 | |
26 | require XSLoader; |
26 | require XSLoader; |
27 | XSLoader::load (__PACKAGE__, $VERSION); |
27 | XSLoader::load (__PACKAGE__, $VERSION); |
28 | } |
28 | } |
29 | |
29 | |
… | |
… | |
75 | and 64 bit and Strawberry Perl 5.16.3 32 and 64 bit, and found to work, |
75 | and 64 bit and Strawberry Perl 5.16.3 32 and 64 bit, and found to work, |
76 | although ActivePerl 32 bit needed a newer MinGW version (that supports XP |
76 | although ActivePerl 32 bit needed a newer MinGW version (that supports XP |
77 | and higher). |
77 | and higher). |
78 | |
78 | |
79 | However, windows doesn't support asynchronous file descriptor passing, so |
79 | However, windows doesn't support asynchronous file descriptor passing, so |
80 | C<send> and C<recv> will have to "rendezvous", that is, they have to wait |
80 | the source process must still be around when the destination process wants |
81 | for each other. Therefore, on windows, it's advisable to run them at the |
81 | to receive the file handle. Also, if the target process fails to fetch the |
82 | same time to avoid any unnecessary delays. |
82 | handle, the handle will leak, so never do that. |
83 | |
83 | |
84 | Also, on windows, the passing process must give the receiving process the |
84 | Also, on windows, the receiving process must have the PROCESS_DUP_HANDLE |
85 | PROCESS_DUP_HANDLE access right for this module to work. |
85 | access right on the sender process for this module to work. |
86 | |
86 | |
87 | Cygwin is not supported at the moment, as file descriptor passing in |
87 | Cygwin is not supported at the moment, as file descriptor passing in |
88 | cygwin is not supported, and cannot be rolled on your own as cygwin has no |
88 | cygwin is not supported, and cannot be rolled on your own as cygwin has no |
89 | (working) method of opening a handle as fd. That is, it has one, but that |
89 | (working) method of opening a handle as fd. That is, it has one, but that |
90 | one isn't exposed to programs, and only used for stdin/out/err. Sigh. |
90 | one isn't exposed to programs, and only used for stdin/out/err. Sigh. |