fp_access Kernel Service

Purpose

Checks for access permission to an open file.

Syntax

#include <sys/types.h> #include <sys/errno.h> int fp_access ( fp, perm) struct file *fp; int perm;

Parameters

Item Description
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).

Description

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

Execution Environment

The fp_access kernel service can be called from the process environment only.

Return Values

Item Description
0 Indicates that the calling process has the requested permission.
EACCES Indicates all other conditions.