summaryrefslogtreecommitdiff
path: root/static/v10/man2/chmod.2
blob: 7727cb5e9e3bfb4e4e661f99673eaefdf67eb53f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.TH CHMOD 2
.CT 2 file_inq_creat dirs secur
.SH NAME
chmod, fchmod \(mi change mode of file
.SH SYNOPSIS
.nf
.B int chmod(name, mode)
.B char *name;
.PP
.B int fchmod(fd, mode)
.fi
.SH DESCRIPTION
.I Chmod
changes the permissions and other mode bits of the file specified 
by the null-terminated string
.I name
to
.IR mode .
.I Fchmod
changes the mode bits of an open file referred
to by a file descriptor.
The modes are defined in
.IR stat (2).
Only the
.B 07777
bits of 
.IR mode
are significant.
.PP
The userid of the process must be
the super-user or the owner of the file.
.PP
Set-groupid mode,
.BR S_ISGID ,
is turned off unless the process is super-user 
or has the same groupid as the file.
.PP
Blind mode,
.BR S_IBLIND ,
cannot be changed unless the process has capability
.BR T_EXTERN ;
see
.IR mkdir(2)
and
.IR getplab (2).
.SH "SEE ALSO"
.IR chmod (1)
.SH DIAGNOSTICS
.BR EBADF ,
.BR EFAULT ,
.BR EIO ,
.BR ELAB ,
.BR ELOOP ,
.BR ENOENT ,
.BR ENOTDIR ,
.BR EPERM ,
.BR EPRIV
.SH BUGS
An attempt to change the mode of
a file on a read-only file system
is quietly ignored.