Commit | Line | Data |
---|---|---|
c334d3e6 KM |
1 | .\" Copyright (c) 1989 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms are permitted | |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
16 | .\" @(#)chflags.2 6.1 (Berkeley) %G% | |
17 | .\" | |
18 | .TH CHFALGS 2 "" | |
19 | .UC 7 | |
20 | .SH NAME | |
21 | chflags, fchflags \- set file flags | |
22 | .SH SYNOPSIS | |
23 | .nf | |
24 | .ft B | |
25 | chflags(path, flags) | |
26 | char *path; | |
27 | long flags; | |
28 | .LP | |
29 | .ft B | |
30 | fchflags(fd, flags) | |
31 | int fd; | |
32 | long flags; | |
33 | .fi | |
34 | .ft R | |
35 | .SH DESCRIPTION | |
36 | The file whose name | |
37 | is given by \fIpath\fP | |
38 | or referenced by the descriptor | |
39 | .I fd | |
40 | has its flags changed to | |
41 | .IR flags . | |
42 | .PP | |
43 | Only the owner of a file (or the super-user) may change the flags. | |
44 | The owner may only change the lower 16 bits of the flags; | |
45 | the super-user may change all 32 bits of the flags. | |
46 | .SH RETURN VALUE | |
47 | Upon successful completion, a value of 0 is returned. | |
48 | Otherwise, \-1 is returned and the global variable | |
49 | .I errno | |
50 | is set to indicate the error. | |
51 | .SH ERRORS | |
52 | .I Chflags | |
53 | fails if one or more of the following are true: | |
54 | .TP 15 | |
55 | [ENOTDIR] | |
56 | A component of the path prefix is not a directory. | |
57 | .TP 15 | |
58 | [EINVAL] | |
59 | The pathname contains a character with the high-order bit set. | |
60 | .TP 15 | |
61 | [ENAMETOOLONG] | |
62 | A component of a pathname exceeded 255 characters, | |
63 | or an entire path name exceeded 1023 characters. | |
64 | .TP 15 | |
65 | [ENOENT] | |
66 | The named file does not exist. | |
67 | .TP 15 | |
68 | [EACCES] | |
69 | Search permission is denied for a component of the path prefix. | |
70 | .TP 15 | |
71 | [ELOOP] | |
72 | Too many symbolic links were encountered in translating the pathname. | |
73 | .TP 15 | |
74 | [EPERM] | |
75 | The effective user ID does not match the owner of the file and | |
76 | the effective user ID is not the super-user. | |
77 | .TP 15 | |
78 | [EROFS] | |
79 | The named file resides on a read-only file system. | |
80 | .TP 15 | |
81 | [EFAULT] | |
82 | .I Path | |
83 | points outside the process's allocated address space. | |
84 | .TP 15 | |
85 | [EIO] | |
86 | An I/O error occurred while reading from or writing to the file system. | |
87 | .PP | |
88 | .I Fchmod | |
89 | will fail if: | |
90 | .TP 15 | |
91 | [EBADF] | |
92 | The descriptor is not valid. | |
93 | .TP 15 | |
94 | [EINVAL] | |
95 | .I Fd | |
96 | refers to a socket, not to a file. | |
97 | .TP 15 | |
98 | [EPERM] | |
99 | The effective user ID does not match the owner of the file and | |
100 | the effective user ID is not the super-user. | |
101 | .TP 15 | |
102 | [EROFS] | |
103 | The file resides on a read-only file system. | |
104 | .TP 15 | |
105 | [EIO] | |
106 | An I/O error occurred while reading from or writing to the file system. | |
107 | .SH "SEE ALSO" | |
108 | chmod(2), open(2), chown(2), stat(2) |