Ausam/doc/man/man2/chmod.2
.th CHMOD II 12/15/74
.sh NAME
chmod \*- change mode of file
.sh SYNOPSIS
(chmod = 15.)
.br
.ft B
sys chmod; name; mode
.s3
chmod(name, mode)
.br
char *name;
.ft R
.sh DESCRIPTION
The file whose name
is given as the null-terminated string pointed to by
.it name
has its mode changed to
.it mode.
Modes are constructed by ORing together some
combination of the following:
.s3
.lp +10 7
4000 set user ID on execution
.lp +10 7
.mc |
2000 make file a locking type
.mc
.lp +10 7
1000 save text image after execution
.lp +10 7
0400 read by owner
.lp +10 7
0200 write by owner
.lp +10 7
0100 execute (search on directory) by owner
.lp +10 7
.mc |
0010 together with bit 02000, turns on autolocking for this file
.mc
.lp +10 7
0007 read, write, execute (search) by others
.i0
.s3
Only the owner of a file (or the super-user) may change the mode.
Only the super-user can set the 1000 mode.
.s3
.mc |
This does not affect the modification date of a file.
.mc
.sh "SEE ALSO"
chmod (I), locking(II)
.sh DIAGNOSTIC
Error bit
(c-bit) set if
.it name
cannot be found or if current user
is neither the owner of the file nor the super-user.
From C, a \*-1 returned value indicates an
error, 0 indicates success.