chmod \- change mode of file
is given as the null-terminated string pointed to by
Modes are constructed by ORing together some
combination of the following:
04000 set user ID on execution
02000 set group ID on execution
01000 save text image after execution
00100 execute (search on directory) by owner
00070 read, write, execute (search) by group
00007 read, write, execute (search) by others
If an executable file is set up for sharing
then mode 1000 prevents the system from
abandoning the swap-space image of the program-text portion
of the file when its last user
Thus when the next user of the file executes it,
the text need not be read from the file
system but can simply be swapped in,
Ability to set this bit is restricted to the super-user
since swap space is consumed
by the images; it is only worth while for heavily used commands.
Only the owner of a file (or the super-user) may change the mode.
Only the super-user can set the 1000 mode.
Zero is returned if the mode is changed;
cannot be found or if current user
is neither the owner of the file nor the super-user.