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.31 by root, Sun Jul 10 01:03:06 2005 UTC vs.
Revision 1.34 by root, Sun Jul 10 17:07:34 2005 UTC

36usually delivers "false") as it's sole argument when the given syscall has 36usually delivers "false") as it's sole argument when the given syscall has
37been executed asynchronously. 37been executed asynchronously.
38 38
39All functions that expect a filehandle will also accept a file descriptor. 39All functions that expect a filehandle will also accept a file descriptor.
40 40
41The filenames you pass to these routines I<must> be absolute. The reason
42is that at the time the request is being executed, the current working
43directory could have changed. Alternatively, you can make sure that you
44never change the current working directory.
45
41=over 4 46=over 4
42 47
43=cut 48=cut
44 49
45package Linux::AIO; 50package Linux::AIO;
114 119
115Returns the number of requests currently outstanding. 120Returns the number of requests currently outstanding.
116 121
117Example: wait till there are no outstanding requests anymore: 122Example: wait till there are no outstanding requests anymore:
118 123
119 Linux::AIO::poll_wait while Linux::AIO::nreqs; 124 Linux::AIO::poll_wait, Linux::AIO::poll_cb
125 while Linux::AIO::nreqs;
120 126
121=item aio_open $pathname, $flags, $mode, $callback 127=item aio_open $pathname, $flags, $mode, $callback
122 128
123Asynchronously open or create a file and call the callback with the 129Asynchronously open or create a file and call the callback with the
124filedescriptor (NOT a perl filehandle, sorry for that, but watch out, this 130filedescriptor (NOT a perl filehandle, sorry for that, but watch out, this
125might change in the future). 131might change in the future).
132
133The pathname passed to C<aio_open> must be absolute. See API NOTES, above,
134for an explanation.
126 135
127The C<$mode> argument is a bitmask. See the C<Fcntl> module for a 136The C<$mode> argument is a bitmask. See the C<Fcntl> module for a
128list. They are the same as used in C<sysopen>. 137list. They are the same as used in C<sysopen>.
129 138
130Example: 139Example:
181 190
182Works like perl's C<stat> or C<lstat> in void context. The callback will 191Works like perl's C<stat> or C<lstat> in void context. The callback will
183be called after the stat and the results will be available using C<stat _> 192be called after the stat and the results will be available using C<stat _>
184or C<-s _> etc... 193or C<-s _> etc...
185 194
195The pathname passed to C<aio_stat> must be absolute. See API NOTES, above,
196for an explanation.
197
186Currently, the stats are always 64-bit-stats, i.e. instead of returning an 198Currently, the stats are always 64-bit-stats, i.e. instead of returning an
187error when stat'ing a large file, the results will be silently truncated 199error when stat'ing a large file, the results will be silently truncated
188unless perl itself is compiled with large file support. 200unless perl itself is compiled with large file support.
189 201
190Example: Print the length of F</etc/passwd>: 202Example: Print the length of F</etc/passwd>:
228 240
229 - aio_open gives a fd, but all other functions expect a perl filehandle. 241 - aio_open gives a fd, but all other functions expect a perl filehandle.
230 242
231=head1 SEE ALSO 243=head1 SEE ALSO
232 244
233L<Coro>. 245L<Coro>, L<IO::AIO>.
234 246
235=head1 AUTHOR 247=head1 AUTHOR
236 248
237 Marc Lehmann <schmorp@schmorp.de> 249 Marc Lehmann <schmorp@schmorp.de>
238 http://home.schmorp.de/ 250 http://home.schmorp.de/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines