CHMOD(2) DOMAIN/IX Reference Manual (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.
The process' effective user ID must either match that of the
file's owner or be the super-user to change the mode of a
file.
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.
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.
[EROFS] The file named resides on a read-only file
system.
Printed 5/10/85 CHMOD-1
CHMOD(2) DOMAIN/IX Reference Manual (SYS5) CHMOD(2)
[EFAULT] Path points outside the allocated address
space of the process.
RETURN VALUE
Chmod returns zero upon successful completion. Otherwise,
it returns a value of -1 and errno is set to indicate the
error.
RELATED INFORMATION
chown(2), mknod(2)
CHMOD-2 Printed 5/10/85