Reads directory entries in standard format.
Item | Description |
---|---|
vp | Points to the virtual node (v-node) of the directory. |
uiop | Points to the uio structure that describes the data area into which to put the block of dirent structures. The starting directory offset is found in the uiop->uio_offset field and the size of the buffer area is found in the uiop->uio_resid field. |
crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. |
The vnop_readdir entry point is used to access directory entries in a standard way. These directories should be returned as an array of dirent structures. The /usr/include/sys/dir.h file contains the definition of a dirent structure.
The vnop_readdir entry point does the following:
The End-of-file character should be indicated by not reading any bytes (not by a partial read). This provides directories with the ability to have some hidden information in each block.
The virtual file system-specific implementation is also responsible for setting the uio_offset field to the offset of the next whole block to be read.
The vnop_readdir entry point can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.