ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.pod
(Generate patch)

Comparing libeio/eio.pod (file contents):
Revision 1.10 by root, Sun Jun 5 23:22:04 2011 UTC vs.
Revision 1.13 by root, Tue Jul 5 09:24:12 2011 UTC

153 153
154You submit a request by calling the relevant C<eio_TYPE> function with the 154You submit a request by calling the relevant C<eio_TYPE> function with the
155required parameters, a callback of type C<int (*eio_cb)(eio_req *req)> 155required parameters, a callback of type C<int (*eio_cb)(eio_req *req)>
156(called C<eio_cb> below) and a freely usable C<void *data> argument. 156(called C<eio_cb> below) and a freely usable C<void *data> argument.
157 157
158The return value will either be 0 158The return value will either be 0, in case something went really wrong
159(which can basically only happen on very fatal errors, such as C<malloc>
160returning 0, which is rather unlikely), or a pointer to the newly-created
161and submitted C<eio_req *>.
159 162
160The callback will be called with an C<eio_req *> which contains the 163The callback will be called with an C<eio_req *> which contains the
161results of the request. The members you can access inside that structure 164results of the request. The members you can access inside that structure
162vary from request to request, except for: 165vary from request to request, except for:
163 166
226custom data value as C<data>. 229custom data value as C<data>.
227 230
228=head3 POSIX API WRAPPERS 231=head3 POSIX API WRAPPERS
229 232
230These requests simply wrap the POSIX call of the same name, with the same 233These requests simply wrap the POSIX call of the same name, with the same
231arguments. If a function is not implemented by the OS and cnanot be emulated 234arguments. If a function is not implemented by the OS and cannot be emulated
232in some way, then all of these return C<-1> and set C<errorno> to C<ENOSYS>. 235in some way, then all of these return C<-1> and set C<errorno> to C<ENOSYS>.
233 236
234=over 4 237=over 4
235 238
236=item eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *data) 239=item eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *data)
316 { 319 {
317 char *target = strndup ((char *)req->ptr2, req->result); 320 char *target = strndup ((char *)req->ptr2, req->result);
318 321
319 free (target); 322 free (target);
320 } 323 }
324
325=item eio_realpath (const char *path, int pri, eio_cb cb, void *data)
326
327Similar to the realpath libc function, but unlike that one, result is
328C<0> on failure and the length of the returned path in C<ptr2> - this is
329similar to readlink.
321 330
322=item eio_stat (const char *path, int pri, eio_cb cb, void *data) 331=item eio_stat (const char *path, int pri, eio_cb cb, void *data)
323 332
324=item eio_lstat (const char *path, int pri, eio_cb cb, void *data) 333=item eio_lstat (const char *path, int pri, eio_cb cb, void *data)
325 334
568 577
569=back 578=back
570 579
571=head3 GROUPING AND LIMITING REQUESTS 580=head3 GROUPING AND LIMITING REQUESTS
572 581
582There is one more rather special request, C<eio_grp>. It is a very special
583aio request: Instead of doing something, it is a container for other eio
584requests.
585
586There are two primary use cases for this: a) bundle many requests into a
587single, composite, request with a definite callback and the ability to
588cancel the whole request with its subrequests and b) limiting the number
589of "active" requests.
590
591Further below you will find more dicussion of these topics - first follows
592the reference section detailing the request generator and other methods.
593
594=over 4
595
596=item eio_grp (eio_cb cb, void *data)
597
598Creates and submits a group request.
599
600=back
601
602
603
573#TODO 604#TODO
574 605
575/*****************************************************************************/ 606/*****************************************************************************/
576/* groups */ 607/* groups */
577 608

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines