CHMOD(2)

NAME
chmod, fchmod - change mode of file

SYNOPSIS
int chmod(name, mode)
char *name;

int fchmod(fd, mode)

DESCRIPTION
Chmod changes the permissions and other mode bits of the file specified by the null-terminated string name to mode. Fchmod changes the mode bits of an open file referred to by a file descriptor. The modes are defined in stat(2). Only the 07777 bits of mode are significant.

The userid of the process must be the super-user or the owner of the file.

Set-groupid mode, S_ISGID, is turned off unless the process is super-user or has the same groupid as the file.

Blind mode, S_IBLIND, cannot be changed unless the process has capability T_EXTERN; see mkdir(2) and getplab(2).

SEE ALSO
chmod(1)

DIAGNOSTICS
EBADF, EFAULT, EIO, ELAB, ELOOP, ENOENT, ENOTDIR, EPERM, EPRIV

BUGS
An attempt to change the mode of a file on a read-only file system is quietly ignored.