Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (a - d) access(2)
NAME
access - Determines the accessibility of a file
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <unistd.h>
int access(
const char *path,
int access_mode);
PARAMETERS
path Points to the file pathname. When the path parameter refers to a symbolic link,
the access() function returns information about the file pointed to by the sym-
bolic link.
Permission to access all components of the path parameter is determined by
using a real user ID instead of an effective user ID, and by using a real group ID
instead of an effective group ID.
access_mode Specifies the type of access. The bit pattern contained in the access_mode
parameter is constructed by a logical OR of values from the following list:
F_OK Checks to see whether the file exists.
R_OK Checks read permission.
W_OK Checks write permission.
X_OK Checks execute (search) permission.
DESCRIPTION
The access() function checks the accessibility of a file specified by a pathname.
Only access bits are checked. A directory can be indicated as writable by access(), but an
attempt to open it for writing could fail (although files can be created there).
To override the file access control mechanism, a process must have a user ID of the super ID.
Files in the Guardian File System
If the specified pathname resolves to the /G directory itself, the calling process has read and exe-
cute access but not write access. The permissions are "r-xr-xr-x".
If the specified pathname resolves to a Guardian process name, the calling process has execute
access but not read or write access. The permissions are "--x--x--x".
If the specified pathname resolves to a Guardian disk volume or subvolume, then the calling pro-
cess has read, write, and execute access. The permissions are "rwxrwxrwx".
If the specified pathname resolves to a regular Guardian disk file, then Guardian standard secu-
rity and Safeguard file-level protection govern access. Refer to the stat(2) reference page for
more information.
527186-003 Hewlett-Packard Company 1−5