Module Name: src
Committed By: njoly
Date: Tue Jul 30 12:38:16 UTC 2013
Modified Files:
src/lib/libc/sys: chown.2
Log Message:
Add fchownat(2) specific errors.
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/sys/chown.2
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/sys/chown.2
diff -u src/lib/libc/sys/chown.2:1.35 src/lib/libc/sys/chown.2:1.36
--- src/lib/libc/sys/chown.2:1.35 Sun Jan 13 08:15:02 2013
+++ src/lib/libc/sys/chown.2 Tue Jul 30 12:38:16 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: chown.2,v 1.35 2013/01/13 08:15:02 dholland Exp $
+.\" $NetBSD: chown.2,v 1.36 2013/07/30 12:38:16 njoly Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)chown.2 8.4 (Berkeley) 4/19/94
.\"
-.Dd November 18, 2012
+.Dd July 30, 2013
.Dt CHOWN 2
.Os
.Sh NAME
@@ -139,14 +139,12 @@ in order to specify the current director
One of the owner or group id's
may be left unchanged by specifying it as (uid_t)\-1 or (gid_t)\-1 respectively.
.Sh RETURN VALUES
-Zero is returned if the operation was successful;
-\-1 is returned if an error occurs, with a more specific
-error code being placed in the global variable
-.Va errno .
+.Rv -std chown lchown fchown fchownat
.Sh ERRORS
-.Fn chown
-and
+.Fn chown ,
.Fn lchown
+and
+.Fn fchownat
will fail and the file will be unchanged if:
.Bl -tag -width Er
.It Bq Er EACCES
@@ -174,6 +172,24 @@ The effective user ID is not the super-u
The named file resides on a read-only file system.
.El
.Pp
+In addition,
+.Fn fchownat
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa path
+does not specify an absolute path and
+.Fa fd
+is neither
+.Dv AT_FDCWD
+nor a valid file descriptor open for reading or searching.
+.It Bq Er ENOTDIR
+.Fa path
+is not an absolute path and
+.Fa fd
+is a file descriptor associated with a non-directory file.
+.El
+.Pp
.Fn fchown
will fail if:
.Bl -tag -width Er