CHMOD(2) DOMAIN/IX SYS5 CHMOD(2)
NAME
chmod - change mode of file
USAGE
int chmod (path, mode)
char *path;
int mode;
DESCRIPTION
Path points to the pathname of a file. Chmod sets the
access permissions of the file's mode according to the bit
pattern defined in mode.
Access permission bits are interpreted as follows:
04000 Set user ID on execution.
02000 Set group ID on execution.
00400 Read by owner.
00200 Write by owner.
00100 Execute (search if a directory) by owner.
00070 Read, write, and execute (search) by group.
00007 Read, write, and execute (search) by others.
Chmod will fail unless the process's effective user ID is
either that of the file's owner or that of the super-user.
If the effective user ID of the process is not super-user
and the effective group ID of the process does not match the
group ID of the file, mode bit 02000 (set group ID on execu-
tion) is cleared.
RETURN VALUE
A successful call returns zero. A failed call returns -1
and sets errno as indicated below.
ERRORS
Chmod fails and the file mode remains the same if one or
more of the following is true:
[ENOTDIR] A component of the path prefix is not a directory.
[ENOENT] The file named does not exist.
[EACCES] Search permission is denied on a component of the
path prefix.
[EPERM] The effective user ID does not match the file
owner's and the effective user ID is not super-
user.
Printed 12/4/86 CHMOD-1
CHMOD(2) DOMAIN/IX SYS5 CHMOD(2)
[EROFS] The file named resides on a read-only file system.
[EFAULT] Path points outside the allocated address space of
the process.
RELATED INFORMATION
chown(2), mknod(2)
CHMOD-2 Printed 12/4/86