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.9 by root, Sun Feb 10 19:25:08 2002 UTC vs.
Revision 1.10 by root, Mon Apr 1 20:30:08 2002 UTC

23use base 'Exporter'; 23use base 'Exporter';
24 24
25BEGIN { 25BEGIN {
26 $VERSION = 0.011; 26 $VERSION = 0.011;
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_open($pathname, $flags, $mode, $callback)
63
64Asynchronously open or create a file and call the callback with the
65filedescriptor.
66
67=item aio_close($fh, $callback)
68
69Asynchronously close a file and call the callback with the result code.
70
62=item aio_read($fh,$offset,$length, $data,$dataoffset,$callback) 71=item aio_read($fh,$offset,$length, $data,$dataoffset,$callback)
63 72
64=item aio_write($fh,$offset,$length, $data,$dataoffset,$callback) 73=item aio_write($fh,$offset,$length, $data,$dataoffset,$callback)
65 74
66Reads or writes C<length> bytes from the specified C<fh> and C<offset> 75Reads or writes C<length> bytes from the specified C<fh> and C<offset>
67into the scalar given by C<data> and offset C<dataoffset> and calls the 76into the scalar given by C<data> and offset C<dataoffset> and calls the
68callback without the actual number of bytes read (or undef on error). 77callback without the actual number of bytes read (or undef on error).
69 78
70=item aio_open($pathname, $flags, $mode, $callback) 79=item aio_stat($fh_or_path,$callback)
71 80
72Asynchronously open or create a file and call the callback with the 81=item aio_lstat($fh,$callback)
73filedescriptor.
74 82
75=item aio_close($fh, $callback) 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...
76 86
77Asynchronously close a file and call the callback with the result code. 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.
78 90
79=cut 91=cut
80 92
81END { 93END {
82 max_parallel 0; 94 max_parallel 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines