fchmod(2) DG/UX R4.11MU05 fchmod(2)
NAME
fchmod - change mode of file
SYNOPSIS
#include <sys/stat.h>
int fchmod (fildes, mode)
int fildes;
int mode;
where:
fildes File descriptor
mode File's new mode
DESCRIPTION
Fildes is a valid, active descriptor referring to an open file of
type ordinary, directory, block special, or character special, or
symbolic link. The file must reside on a file system device mounted
read-write. Fchmod changes the file's mode (stmode) in a manner
semantically identical to the way chmod does.
ACCESS CONTROL
The calling process must have appropriate privilege or the effective
user id of the calling process must match the user id of the file.
For systems supporting the DG/UX Capability Option, appropriate
privilege is defined as having one or more specific capabilities
enabled in the effective capability set of the calling process. See
capdefaults(5) for the default capability for this system call.
On systems without the DG/UX Capability Option, appropriate privilege
means that the process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
The calling process must have appropriate privilege to set the sticky
bit. To set the set-group-id bit, the calling process must have
appropriate privilege or its effective group id must match the file's
group id. Failure to meet the requirements for setting one of these
bits does not produce an error. Note that meeting the first access
requirement is sufficient to allow a process to set the set-user-id
bit.
RETURN VALUE
0 The file's mode was successfully changed.
-1 An error occurred. errno is set to indicate the error.
DIAGNOSTICS
Errno may be set to one of the following error codes:
EBADF Fildes is not a valid, active file descriptor.
EINVAL The file descriptor refers to a pipe or an object that is
not a file.
EPERM The process is denied permission to change the file's mode.
EROFS The named file resides on a file system device mounted
read-only.
SEE ALSO
chmod(1), chmod(2), chown(2), creat(2), fchown(2), fcntl(2),
fstat(2), mknod(2), mknod(2), open(2), read(2), stat(2), write(2),
appropriateprivilege(5).
capdefaults(5).
Licensed material--property of copyright holder(s)