Sets attributes of a file.
The vnop_setattr entry point is used by the logical file system to set the attributes of a file. This entry point is used to implement the chmod, chownx, and utime subroutines.
The values that the arg parameters take depend on the value of the cmd parameter. The vnop_setattr entry point accepts the following cmd values and arg parameters:
Command | V_OWN | V_UTIME | V_MODE |
---|---|---|---|
arg1 | int flag; | int flag; | int mode; |
arg2 | int uid; | timestruc_t *atime; | Unused |
arg3 | int gid; | timestruc_t *mtime; | Unused |
Item | Description |
---|---|
vp | Points to the virtual node (v-node) of the file. |
cmd | Defines the setting operation. This parameter takes the following
values:
|
arg1, arg2, arg3 | Specify the command arguments. The values of the command arguments depend on which command calls the vnop_setattr entry point. |
crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. |
The vnop_setattr 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.