Checks for access permission to an open file.
#include <sys/types.h>
#include <sys/errno.h>
int
fp_access ( fp, perm)
struct file *fp;
int perm;
fp | Points to a file structure returned by the fp_open or fp_opendev kernel service. |
perm | Indicates which read, write, and execute permissions are to be checked. The /usr/include/sys/mode.h file contains pertinent values (IREAD, IWRITE, IEXEC). |
The fp_access kernel service is used to see if either the read, write, or exec bit is set anywhere in a file's permissions mode. Set perm to one of the following constants from mode.h:
IREAD
IWRITE
IEXEC
The fp_access kernel service can be called from the process environment only.
0 | Indicates that the calling process has the requested permission. |
EACCES | Indicates all other conditions. |
The access subroutine.
Logical File System Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.