ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-AIO/AIO.pm
(Generate patch)

Comparing Linux-AIO/AIO.pm (file contents):
Revision 1.7 by root, Mon Oct 8 12:58:41 2001 UTC vs.
Revision 1.12 by root, Sat May 18 21:48:36 2002 UTC

21package Linux::AIO; 21package Linux::AIO;
22 22
23use base 'Exporter'; 23use base 'Exporter';
24 24
25BEGIN { 25BEGIN {
26 $VERSION = 0.01; 26 $VERSION = 0.111;
27 27
28 @EXPORT = qw(aio_read aio_write aio_open aio_close); 28 @EXPORT = qw(aio_read aio_write aio_open aio_close aio_stat aio_lstat);
29 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs); 29 @EXPORT_OK = qw(poll_fileno poll_cb min_parallel max_parallel nreqs);
30 30
31 require XSLoader; 31 require XSLoader;
32 XSLoader::load Linux::AIO, $VERSION; 32 XSLoader::load Linux::AIO, $VERSION;
33} 33}
57 57
58=item Linux::AIO::nreqs 58=item Linux::AIO::nreqs
59 59
60Returns the number of requests currently outstanding. 60Returns the number of requests currently outstanding.
61 61
62=item aio_read($fh,$offset,$length, $data,$dataoffset,$callback)
63aio_write($fh,$offset,$length, $data,$dataoffset,$callback)
64
65Reads or writes C<length> bytes from the specified C<fh> and C<offset>
66into the scalar given by C<data> and offset C<dataoffset> and calls the
67callback without the actual number of bytes read (or undef on error).
68
69=item aio_open($pathname, $flags, $mode, $callback) 62=item aio_open($pathname, $flags, $mode, $callback)
70 63
71Asynchronously open or create a file and call the callback with the 64Asynchronously open or create a file and call the callback with the
72filedescriptor. 65filedescriptor.
73 66
74=item aio_close($fh, $callback) 67=item aio_close($fh, $callback)
75 68
76Asynchronously close a file and call the callback with the result code. 69Asynchronously close a file and call the callback with the result code.
70
71=item aio_read($fh,$offset,$length, $data,$dataoffset,$callback)
72
73=item aio_write($fh,$offset,$length, $data,$dataoffset,$callback)
74
75Reads or writes C<length> bytes from the specified C<fh> and C<offset>
76into the scalar given by C<data> and offset C<dataoffset> and calls the
77callback without the actual number of bytes read (or undef on error).
78
79=item aio_stat($fh_or_path,$callback)
80
81=item aio_lstat($fh,$callback)
82
83Works like perl's C<stat> or C<lstat> in void context, i.e. the callback
84will be called after the stat and the results will be available using
85C<stat _> or C<-s _> etc...
86
87Currently, the stats are always 64-bit-stats, i.e. instead of returning an
88error when stat'ing a large file, the results will be silently truncated
89unless perl itself is compiled with large file support.
77 90
78=cut 91=cut
79 92
80END { 93END {
81 max_parallel 0; 94 max_parallel 0;
87 100
88=head1 BUGS 101=head1 BUGS
89 102
90This module has not yet been extensively tested. Watch out! 103This module has not yet been extensively tested. Watch out!
91 104
92 - aio_stat/lstat are seriously missing here. 105 - perl-threads/fork interaction poorly tested.
106 - aio_open gives a fd, but all other functions expect a filehandle.
93 107
94=head1 SEE ALSO 108=head1 SEE ALSO
95 109
96L<Coro>. 110L<Coro>.
97 111

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines