ACCESS(2-SVR3) RISC/os Reference Manual ACCESS(2-SVR3)
NAME
access - determine accessibility of a file
SYNOPSIS
int access (path, amode)
char *path;
int amode;
DESCRIPTION
path points to a path name naming a file. access checks the
named file for accessibility according to the bit pattern
contained in amode, using the real user ID in place of the
effective user ID and the real group ID in place of the
effective group ID.
The symbolic constants for the argument amode are defined in
the <unistd.h> header file and are as follows:
ROK test for read permission.
WOK test for write permission.
XOK test for write (search) permission.
FOK test existence of file
The argument amode is either the logical OR of one or more
of the values of the symbolic constant for ROK, WOK, and
XOK or is the value of the symbolic constant FOK.
The owner of a file has permission checked with respect to
the ``owner'' read, write, and execute mode bits. Members
of the file's group other than the owner have permissions
checked with respect to the ``group'' mode bits, and all
others have permissions checked with respect to the
``other'' mode bits.
ERRORS
Access to the file is denied if one or more of the following
are true:
[EINVAL] amode is invalid.
[ENOTDIR] A component of the path prefix is
not a directory.
[ENOENT] Read, write, or execute (search)
permission is requested for a null
path name.
[ENOENT] The named file does not exist.
[EACCES] Search permission is denied on a
component of the path prefix.
Printed 11/19/92 Page 1
ACCESS(2-SVR3) RISC/os Reference Manual ACCESS(2-SVR3)
[EROFS] Write access is requested for a
file on a read-only file system.
[ETXTBSY] Write access is requested for a
pure procedure(shared text) file
that is being executed.
[EACCES] Permission bits of the file mode do
not permit the requested access.
[EFAULT] path points outside the allocated
address space for the process.
[EINTR] A signal was caught during the
access system call.
[ENOLINK] path points to a remote machine and
the link to that machine is no
longer active.
[EMULTIHOP] Components of path require hopping
to multiple remote machines.
SEE ALSO
chmod(2), stat(2).
DIAGNOSTICS
If the requested access is permitted, a value of 0 is
returned. Otherwise, a value of -1 is returned and errno is
set to indicate the error.
Page 2 Printed 11/19/92