--- libeio/eio.pod 2011/06/05 23:07:46 1.9 +++ libeio/eio.pod 2011/06/05 23:22:04 1.10 @@ -228,14 +228,13 @@ =head3 POSIX API WRAPPERS These requests simply wrap the POSIX call of the same name, with the same -arguments: +arguments. If a function is not implemented by the OS and cnanot be emulated +in some way, then all of these return C<-1> and set C to C. =over 4 =item eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *data) -=item eio_utime (const char *path, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data) - =item eio_truncate (const char *path, off_t offset, int pri, eio_cb cb, void *data) =item eio_chown (const char *path, uid_t uid, gid_t gid, int pri, eio_cb cb, void *data) @@ -248,13 +247,7 @@ =item eio_unlink (const char *path, int pri, eio_cb cb, void *data) -=item eio_readlink (const char *path, int pri, eio_cb cb, void *data) /* result=ptr2 allocated dynamically */ - -=item eio_stat (const char *path, int pri, eio_cb cb, void *data) /* stat buffer=ptr2 allocated dynamically */ - -=item eio_lstat (const char *path, int pri, eio_cb cb, void *data) /* stat buffer=ptr2 allocated dynamically */ - -=item eio_statvfs (const char *path, int pri, eio_cb cb, void *data) /* stat buffer=ptr2 allocated dynamically */ +=item eio_utime (const char *path, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data) =item eio_mknod (const char *path, mode_t mode, dev_t dev, int pri, eio_cb cb, void *data) @@ -264,12 +257,8 @@ =item eio_rename (const char *path, const char *new_path, int pri, eio_cb cb, void *data) -=item eio_msync (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) - =item eio_mlock (void *addr, size_t length, int pri, eio_cb cb, void *data) -=item eio_mlockall (int flags, int pri, eio_cb cb, void *data) - =item eio_close (int fd, int pri, eio_cb cb, void *data) =item eio_sync (int pri, eio_cb cb, void *data) @@ -307,6 +296,33 @@ so it is advised not to submit multiple requests on the same fd on this horrible pile of garbage. +=item eio_mlockall (int flags, int pri, eio_cb cb, void *data) + +Like C, but the flag value constants are called +C and C. + +=item eio_msync (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) + +Just like msync, except that the flag values are called C, +C and C. + +=item eio_readlink (const char *path, int pri, eio_cb cb, void *data) + +If successful, the path read by C can be accessed via C<< +req->ptr2 >> and is I null-terminated, with the length specified as +C<< req->result >>. + + if (req->result >= 0) + { + char *target = strndup ((char *)req->ptr2, req->result); + + free (target); + } + +=item eio_stat (const char *path, int pri, eio_cb cb, void *data) + +=item eio_lstat (const char *path, int pri, eio_cb cb, void *data) + =item eio_fstat (int fd, int pri, eio_cb cb, void *data) Stats a file - if C<< req->result >> indicates success, then you can @@ -314,7 +330,9 @@ EIO_STRUCT_STAT *statdata = (EIO_STRUCT_STAT *)req->ptr2; -=item eio_fstatvfs (int fd, int pri, eio_cb cb, void *data) /* stat buffer=ptr2 allocated dynamically */ +=item eio_statvfs (const char *path, int pri, eio_cb cb, void *data) + +=item eio_fstatvfs (int fd, int pri, eio_cb cb, void *data) Stats a filesystem - if C<< req->result >> indicates success, then you can access the C-like structure via C<< req->ptr2 >>: @@ -340,7 +358,7 @@ argument. The C<< req->result >> indicates either the number of files found, or -C<-1> on error. On success, zero-terminated names can be found as C<< req->ptr2 >>, +C<-1> on error. On success, null-terminated names can be found as C<< req->ptr2 >>, and C, if requested by C, can be found via C<< req->ptr1 >>. @@ -482,6 +500,9 @@ Calls C. If the syscall is missing, then this is the same as calling C. +Flags can be any combination of C, +C and C. + =back =head3 LIBEIO-SPECIFIC REQUESTS