1CHMOD(2) System Calls Manual CHMOD(2)
2
3
4
6 chmod - change mode of file
7
9 chmod(name, mode)
10 char *name;
11
13 The file whose name is given as the null-terminated string pointed to
14 by name has its mode changed to mode. Modes are constructed by ORing
15 together some combination of the following:
16
17 04000 set user ID on execution
18 02000 set group ID on execution
19 01000 save text image after execution
20 00400 read by owner
21 00200 write by owner
22 00100 execute (search on directory) by owner
23 00070 read, write, execute (search) by group
24 00007 read, write, execute (search) by others
25
26 If an executable file is set up for sharing (-n or -i option of ld(1))
27 then mode 1000 prevents the system from abandoning the swap-space image
28 of the program-text portion of the file when its last user terminates.
29 Thus when the next user of the file executes it, the text need not be
30 read from the file system but can simply be swapped in, saving time.
31 Ability to set this bit is restricted to the super-user since swap
32 space is consumed by the images; it is only worth while for heavily
33 used commands.
34
35 Only the owner of a file (or the super-user) may change the mode. Only
36 the super-user can set the 1000 mode.
37
39 chmod(1)
40
42 Zero is returned if the mode is changed; -1 is returned if name cannot
43 be found or if current user is neither the owner of the file nor the
44 super-user.
45
47 (chmod = 15.)
48 sys chmod; name; mode
49
50
51
52 CHMOD(2)