Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/sys/chmod.2,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libc/sys/chmod.2,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.45 retrieving revision 1.46 diff -u -p -r1.45 -r1.46 --- src/lib/libc/sys/chmod.2 2013/01/13 08:15:02 1.45 +++ src/lib/libc/sys/chmod.2 2013/07/29 19:18:37 1.46 @@ -1,4 +1,4 @@ -.\" $NetBSD: chmod.2,v 1.45 2013/01/13 08:15:02 dholland Exp $ +.\" $NetBSD: chmod.2,v 1.46 2013/07/29 19:18:37 njoly Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" -.Dd November 18, 2012 +.Dd July 29, 2013 .Dt CHMOD 2 .Os .Sh NAME @@ -175,14 +175,12 @@ by protecting set-user-id (set-group-id) from remaining set-user-id (set-group-id) if they are modified, at the expense of a degree of compatibility. .Sh RETURN VALUES -Upon successful completion, a value of 0 is returned. -Otherwise, a value of \-1 is returned and -.Va errno -is set to indicate the error. +.Rv -std chmod lchmod fchmod fchmodat .Sh ERRORS -.Fn chmod -and +.Fn chmod , .Fn lchmod +and +.Fn fchmodat will fail and the file mode will be unchanged if: .Bl -tag -width Er .It Bq Er EACCES @@ -223,6 +221,24 @@ group access list. The named file resides on a read-only file system. .El .Pp +In addition, +.Fn fchmodat +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 fchmod will fail if: .Bl -tag -width Er