Module Name: src Committed By: njoly Date: Mon Jul 29 18:37:16 UTC 2013
Modified Files: src/lib/libc/sys: open.2 Log Message: Add openat(2) specific errors. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/lib/libc/sys/open.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/open.2 diff -u src/lib/libc/sys/open.2:1.55 src/lib/libc/sys/open.2:1.56 --- src/lib/libc/sys/open.2:1.55 Sun Jan 13 08:15:02 2013 +++ src/lib/libc/sys/open.2 Mon Jul 29 18:37:16 2013 @@ -1,4 +1,4 @@ -.\" $NetBSD: open.2,v 1.55 2013/01/13 08:15:02 dholland Exp $ +.\" $NetBSD: open.2,v 1.56 2013/07/29 18:37:16 njoly Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" -.Dd November 18, 2012 +.Dd July 29, 2013 .Dt OPEN 2 .Os .Sh NAME @@ -288,6 +288,8 @@ returns the current system limit. .Sh RETURN VALUES If successful, .Fn open +and +.Fn openat returns a non-negative integer, termed a file descriptor. Otherwise, a value of \-1 is returned and .Va errno @@ -405,6 +407,24 @@ executed and the .Fn open call requests write access. .El +.Pp +In addition, +.Fn openat +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 .Sh SEE ALSO .Xr chmod 2 , .Xr close 2 , @@ -418,7 +438,6 @@ call requests write access. .Xr mkdirat 2 , .Xr mkfifoat 2 , .Xr mknodat 2 , -.Xr openat 2 , .Xr read 2 , .Xr readlinkat 2 , .Xr symlinkat 2 ,