VOP_READDIR(9) | Kernel Developer's Manual | VOP_READDIR(9) |
VOP_READDIR
— read
contents of a directory
#include
<sys/param.h>
#include <sys/dirent.h>
#include <sys/vnode.h>
int
VOP_READDIR
(struct
vnode *vp, struct uio
*uio, struct ucred
*cred, int
*eofflag, int
*ncookies, u_long
**cookies);
Read directory entries.
NULL
if not
wanted).NULL
if not wanted).NULL
if
not wanted).The directory should be locked on entry and will still be locked on exit.
Zero is returned on success, otherwise an error code is returned.
If this is called from the NFS server, the extra arguments eofflag, ncookies and cookies are given. The value of *eofflag should be set to TRUE if the end of the directory is reached while reading. The directory seek cookies are returned to the NFS client and may be used later to restart a directory read part way through the directory. There should be one cookie returned per directory entry. The value of the cookie should be the offset within the directory where the on-disc version of the appropriate directory entry starts. Memory for the cookies should be allocated using:
...; *ncookies = number of entries read; *cookies = malloc(*ncookies * sizeof(u_long), M_TEMP, M_WAITOK);
EINVAL
]EIO
]EINTEGRITY
]This manual page was written by Doug Rabson.
March 30, 2020 | Debian |