int vn_setattr (vp, cmd, arg1, arg2, arg3, crp) struct vnode *vp; int cmd; int arg1; int arg2; int arg3; struct ucred *crp;
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 vn_setattr entry point. |
crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. |
The vn_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 vn_setattr entry point accepts the following cmd values and arg parameters:
Possible cmd Values for the vn_setattr Entry Point | |||
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 |
Note: For V_UTIME, if arg2 or arg3 is NULL, then the corresponding time field, atime and mtime, of the file should be left unchanged.
The vn_setattr entry point can be called from the process environment only.
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.
The chmod subroutine, chownx subroutine, utime subroutine.
Virtual File System Kernel Extensions Overview, Understanding Virtual Nodes (V-nodes) in AIX Kernel Extensions and Device Support Programming Concepts.
List of Virtual File System Operations.