source: trunk/minix/man/man2/chown.2@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 2.2 KB
Line 
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)chown.2 6.6 (Berkeley) 5/22/86
6.\"
7.TH CHOWN 2 "May 22, 1986"
8.UC 4
9.SH NAME
10chown \- change owner and group of a file
11.SH SYNOPSIS
12.nf
13.ft B
14int chown(const char *\fIpath\fP, int \fIowner\fP, int \fIgroup\fP)
15.ig \" You never know
16.PP
17.ft B
18int fchown(int \fIfd\fP, int \fIowner\fP, int \fIgroup\fP)
19..
20.fi
21.SH DESCRIPTION
22The file
23that is named by \fIpath\fP
24.ig
25or referenced by \fIfd\fP
26..
27has its
28.I owner
29and
30.I group
31changed as specified.
32Only the super-user
33may change the owner of the file,
34because if users were able to give files away,
35they could defeat file-space accounting procedures.
36The owner of the file may change the group
37to a group of which he is a member.
38.PP
39On some systems,
40.I chown
41clears the set-user-id and set-group-id bits
42on the file
43to prevent accidental creation of
44set-user-id and set-group-id programs.
45.SH "RETURN VALUE
46Zero is returned if the operation was successful;
47\-1 is returned if an error occurs, with a more specific
48error code being placed in the global variable \fBerrno\fP.
49.SH "ERRORS
50.B Chown
51will fail and the file will be unchanged if:
52.TP 15
53[ENOTDIR]
54A component of the path prefix is not a directory.
55.TP 15
56[ENAMETOOLONG]
57The path name exceeds PATH_MAX characters.
58.TP 15
59[ENOENT]
60The named file does not exist.
61.TP 15
62[EACCES]
63Search permission is denied for a component of the path prefix.
64.TP 15
65[ELOOP]
66Too many symbolic links were encountered in translating the pathname.
67(Minix-vmd)
68.TP 15
69[EPERM]
70The effective user ID is not the super-user.
71.TP 15
72[EROFS]
73The named file resides on a read-only file system.
74.TP 15
75[EFAULT]
76.I Path
77points outside the process's allocated address space.
78.TP 15
79[EIO]
80An I/O error occurred while reading from or writing to the file system.
81.ig
82.PP
83.B Fchown
84will fail if:
85.TP 15
86[EBADF]
87.I Fd
88does not refer to a valid descriptor.
89.TP 15
90[EPERM]
91The effective user ID is not the super-user.
92.TP 15
93[EROFS]
94The named file resides on a read-only file system.
95.TP 15
96[EIO]
97An I/O error occurred while reading from or writing to the file system.
98..
99.SH "SEE ALSO"
100.BR chown (8),
101.BR chgrp (1),
102.BR chmod (2).
Note: See TracBrowser for help on using the repository browser.