vnop_rmdir Entry Point
Purpose
Removes a directory.
Syntax
Parameters
Item | Description |
---|---|
vp | Points to the virtual node (v-node) of the directory. |
dp | Points to the parent of the directory to remove. |
pname | Points to the name of the directory to remove. |
crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. |
Description
The vnop_rmdir entry point is invoked by the logical file system to remove a directory object. To remove a directory, the directory must be empty (except for the current and parent directories). Before removing the directory, the logical file system ensures the following:
- The vp parameter is a directory.
- The vp parameter is not the root of a virtual file system.
- The vp parameter is not the current directory.
- The dp parameter
does not reside on a read-only file system. Note: The vp and dp parameters' v-nodes (virtual nodes) are held for the duration of the routine.
Execution Environment
The vnop_rmdir entry point can be called from the process environment only.
Return Values
Item | Description |
---|---|
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.