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