summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-03-31 05:07:56 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-03-31 05:07:56 +0000
commitd0b5aae721ff3828901eb5d8dbb8a731c887ba46 (patch)
tree37f1db21e2d1b02371eb7367f7895fc1ab6928cb
parent407a41a466eb046367055de035cb56664707a1cd (diff)
Use consistent wording for the EINVAL, EBADF, ENOTDIR, and EACCES cases
of the various *at() functions.
-rw-r--r--lib/libc/sys/access.29
-rw-r--r--lib/libc/sys/chmod.29
-rw-r--r--lib/libc/sys/chown.226
-rw-r--r--lib/libc/sys/link.239
-rw-r--r--lib/libc/sys/mkdir.221
-rw-r--r--lib/libc/sys/mkfifo.221
-rw-r--r--lib/libc/sys/mknod.221
-rw-r--r--lib/libc/sys/open.221
-rw-r--r--lib/libc/sys/readlink.221
-rw-r--r--lib/libc/sys/rename.234
-rw-r--r--lib/libc/sys/symlink.221
-rw-r--r--lib/libc/sys/unlink.238
-rw-r--r--lib/libc/sys/utimes.228
13 files changed, 250 insertions, 59 deletions
diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2
index fee8a9470d7..afb51edece3 100644
--- a/lib/libc/sys/access.2
+++ b/lib/libc/sys/access.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: access.2,v 1.20 2013/03/30 06:44:44 guenther Exp $
+.\" $OpenBSD: access.2,v 1.21 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: access.2,v 1.7 1995/02/27 12:31:44 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)access.2 8.2 (Berkeley) 4/1/94
.\"
-.Dd $Mdocdate: March 30 2013 $
+.Dd $Mdocdate: March 31 2013 $
.Dt ACCESS 2
.Os
.Sh NAME
@@ -180,6 +180,11 @@ Additionally,
.Fn faccessat
will fail if:
.Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa flag
+argument was neither zero nor
+.Dv AT_EACCESS .
.It Bq Er EBADF
The
.Fa path
diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2
index 32758b0d53f..d098579753e 100644
--- a/lib/libc/sys/chmod.2
+++ b/lib/libc/sys/chmod.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: chmod.2,v 1.20 2013/03/30 06:44:44 guenther Exp $
+.\" $OpenBSD: chmod.2,v 1.21 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: chmod.2,v 1.7 1995/02/27 12:32:06 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)chmod.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: March 30 2013 $
+.Dd $Mdocdate: March 31 2013 $
.Dt CHMOD 2
.Os
.Sh NAME
@@ -200,6 +200,11 @@ Additionally, the
.Fn fchmodat
function will fail if:
.Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa flag
+argument was neither zero nor
+.Dv AT_SYMLINK_NOFOLLOW .
.It Bq Er EBADF
The
.Fa path
diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2
index 673c364605e..dde8c2f2176 100644
--- a/lib/libc/sys/chown.2
+++ b/lib/libc/sys/chown.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: chown.2,v 1.19 2011/11/07 11:33:24 schwarze Exp $
+.\" $OpenBSD: chown.2,v 1.20 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: chown.2,v 1.10 1995/10/12 15:40:47 jtc Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
@@ -30,7 +30,7 @@
.\"
.\" @(#)chown.2 8.4 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: November 7 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt CHOWN 2
.Os
.Sh NAME
@@ -179,14 +179,32 @@ Additionally,
.Fn fchownat
will fail if:
.Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa flag
+argument was neither zero nor
+.Dv AT_SYMLINK_NOFOLLOW .
.It Bq Er EBADF
The
.Fa path
-argument does not specify an absolute path and the
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa path
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Pp
.Fn fchown
diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2
index 7ebc3a83079..e3be19067e1 100644
--- a/lib/libc/sys/link.2
+++ b/lib/libc/sys/link.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: link.2,v 1.22 2011/11/17 14:26:14 schwarze Exp $
+.\" $OpenBSD: link.2,v 1.23 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: link.2,v 1.7 1995/02/27 12:34:01 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)link.2 8.3 (Berkeley) 1/12/94
.\"
-.Dd $Mdocdate: November 17 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt LINK 2
.Os
.Sh NAME
@@ -214,18 +214,45 @@ Additionally,
.Fn linkat
will fail if:
.Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa flag
+argument was neither zero nor
+.Dv AT_SYMLINK_FOLLOW .
.It Bq Er EBADF
The
.Fa name1
or
.Fa name2
-argument does not specify an absolute path and
+argument specifies a relative path and the
.Fa fd1
or
-.Fa fd2 ,
-respectively, is neither
+.Fa fd2
+argument, respectively, is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa name1
+or
+.Fa name2
+argument specifies a relative path and the
+.Fa fd1
+or
+.Fa fd2
+argument, respectively,
+is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa name1
+or
+.Fa name2
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd1
+or
+.Fa fd2
+file descriptor, respectively, references.
.El
.Sh SEE ALSO
.Xr ln 1 ,
diff --git a/lib/libc/sys/mkdir.2 b/lib/libc/sys/mkdir.2
index 40dacbf039e..740350eb982 100644
--- a/lib/libc/sys/mkdir.2
+++ b/lib/libc/sys/mkdir.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mkdir.2,v 1.11 2011/11/17 14:26:14 schwarze Exp $
+.\" $OpenBSD: mkdir.2,v 1.12 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: mkdir.2,v 1.8 1995/02/27 12:34:22 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)mkdir.2 8.2 (Berkeley) 12/11/93
.\"
-.Dd $Mdocdate: November 17 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt MKDIR 2
.Os
.Sh NAME
@@ -138,11 +138,24 @@ will fail if:
.It Bq Er EBADF
The
.Fa path
-argument does not specify an absolute path and the
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa path
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Sh SEE ALSO
.Xr chmod 2 ,
diff --git a/lib/libc/sys/mkfifo.2 b/lib/libc/sys/mkfifo.2
index f696dd762d1..7cb23f37427 100644
--- a/lib/libc/sys/mkfifo.2
+++ b/lib/libc/sys/mkfifo.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mkfifo.2,v 1.9 2011/07/18 23:04:40 matthew Exp $
+.\" $OpenBSD: mkfifo.2,v 1.10 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: mkfifo.2,v 1.8 1995/02/27 12:34:27 cgd Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)mkfifo.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: July 18 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt MKFIFO 2
.Os
.Sh NAME
@@ -148,11 +148,24 @@ will fail if:
.It Bq Er EBADF
The
.Fa path
-argument does not specify an absolute path and the
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa path
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Sh SEE ALSO
.Xr chmod 2 ,
diff --git a/lib/libc/sys/mknod.2 b/lib/libc/sys/mknod.2
index 81079bac018..da3f52893e0 100644
--- a/lib/libc/sys/mknod.2
+++ b/lib/libc/sys/mknod.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mknod.2,v 1.15 2013/03/30 06:44:44 guenther Exp $
+.\" $OpenBSD: mknod.2,v 1.16 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: mknod.2,v 1.6 1995/02/27 12:34:33 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)mknod.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: March 30 2013 $
+.Dd $Mdocdate: March 31 2013 $
.Dt MKNOD 2
.Os
.Sh NAME
@@ -158,11 +158,24 @@ will fail if:
.It Bq Er EBADF
The
.Fa path
-argument does not specify an absolute path and the
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa path
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Sh SEE ALSO
.Xr chmod 2 ,
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index 2e1e373d0c5..af4d35bdce4 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: open.2,v 1.43 2013/03/30 06:44:44 guenther Exp $
+.\" $OpenBSD: open.2,v 1.44 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: open.2,v 1.8 1995/02/27 12:35:14 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)open.2 8.2 (Berkeley) 11/16/93
.\"
-.Dd $Mdocdate: March 30 2013 $
+.Dd $Mdocdate: March 31 2013 $
.Dt OPEN 2
.Os
.Sh NAME
@@ -371,11 +371,24 @@ function will fail if:
.It Bq Er EBADF
The
.Fa path
-argument does not specify an absolute path and the
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa path
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Sh SEE ALSO
.Xr chflags 2 ,
diff --git a/lib/libc/sys/readlink.2 b/lib/libc/sys/readlink.2
index 96973aa7d5e..ec15ad22ef2 100644
--- a/lib/libc/sys/readlink.2
+++ b/lib/libc/sys/readlink.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: readlink.2,v 1.13 2011/07/18 23:04:40 matthew Exp $
+.\" $OpenBSD: readlink.2,v 1.14 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: readlink.2,v 1.7 1995/02/27 12:35:54 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)readlink.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: July 18 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt READLINK 2
.Os
.Sh NAME
@@ -125,11 +125,24 @@ will fail if:
.It Bq Er EBADF
The
.Fa path
-argument does not specify an absolute path and the
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa path
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Sh SEE ALSO
.Xr lstat 2 ,
diff --git a/lib/libc/sys/rename.2 b/lib/libc/sys/rename.2
index 1eac3a43474..5609fbe7cd7 100644
--- a/lib/libc/sys/rename.2
+++ b/lib/libc/sys/rename.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rename.2,v 1.16 2011/07/19 07:06:22 jmc Exp $
+.\" $OpenBSD: rename.2,v 1.17 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: rename.2,v 1.7 1995/02/27 12:36:15 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)rename.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: July 19 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt RENAME 2
.Os
.Sh NAME
@@ -220,13 +220,35 @@ The
.Fa from
or
.Fa to
-argument does not specify an absolute path and
+argument specifies a relative path and the
.Fa fromfd
or
-.Fa tofd ,
-respectively, is neither
+.Fa tofd
+argument, respectively, is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa from
+or
+.Fa to
+argument specifies a relative path and the
+.Fa fromfd
+or
+.Fa tofd
+argument, respectively,
+is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa from
+or
+.Fa to
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fromfd
+or
+.Fa tofd
+file descriptor, respectively, references.
.El
.Sh SEE ALSO
.Xr mv 1 ,
diff --git a/lib/libc/sys/symlink.2 b/lib/libc/sys/symlink.2
index 1b6293f4917..6ccbde2a79a 100644
--- a/lib/libc/sys/symlink.2
+++ b/lib/libc/sys/symlink.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: symlink.2,v 1.13 2011/07/18 23:04:40 matthew Exp $
+.\" $OpenBSD: symlink.2,v 1.14 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: symlink.2,v 1.7 1995/02/27 12:38:34 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)symlink.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: July 18 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt SYMLINK 2
.Os
.Sh NAME
@@ -161,11 +161,24 @@ will fail if:
.It Bq Er EBADF
The
.Fa name2
-argument does not specify an absolute path and the
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa name2
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa name2
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Sh SEE ALSO
.Xr ln 1 ,
diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2
index ba66358a51a..b563b92ecf8 100644
--- a/lib/libc/sys/unlink.2
+++ b/lib/libc/sys/unlink.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: unlink.2,v 1.20 2011/11/06 17:22:20 schwarze Exp $
+.\" $OpenBSD: unlink.2,v 1.21 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: unlink.2,v 1.7 1995/02/27 12:39:13 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)unlink.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: November 6 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt UNLINK 2
.Os
.Sh NAME
@@ -165,14 +165,6 @@ Additionally,
.Fn unlinkat
will fail if:
.Bl -tag -width Er
-.It Bq Er EBADF
-The
-.Fa path
-argument does not specify an absolute path and the
-.Fa fd
-argument is neither
-.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
.It Bq Er ENOTDIR
The
.Dv AT_REMOVEDIR
@@ -187,6 +179,32 @@ flag bit is set and the named directory contains files other than
and
.Ql \&..
in it.
+.It Bq Er EINVAL
+The value of the
+.Fa flag
+argument was neither zero nor
+.Dv AT_REMOVEDIR .
+.It Bq Er EBADF
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is neither
+.Dv AT_FDCWD
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa path
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa path
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Sh SEE ALSO
.Xr rm 1 ,
diff --git a/lib/libc/sys/utimes.2 b/lib/libc/sys/utimes.2
index a30cd617992..8d5c69f57e9 100644
--- a/lib/libc/sys/utimes.2
+++ b/lib/libc/sys/utimes.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: utimes.2,v 1.17 2011/11/17 14:26:14 schwarze Exp $
+.\" $OpenBSD: utimes.2,v 1.18 2013/03/31 05:07:55 guenther Exp $
.\" $NetBSD: utimes.2,v 1.9 1996/04/23 10:34:16 mycroft Exp $
.\"
.\" Copyright (c) 1990, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: November 17 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt UTIMES 2
.Os
.Sh NAME
@@ -193,14 +193,32 @@ Additionally,
.Fn utimensat
will fail if:
.Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa flag
+argument was neither zero nor
+.Dv AT_SYMLINK_NOFOLLOW .
.It Bq Er EBADF
The
-.Fa path
-argument does not specify an absolute path and the
+.Fa file
+argument specifies a relative path and the
.Fa fd
argument is neither
.Dv AT_FDCWD
-nor a valid file descriptor open for reading.
+nor a valid file descriptor.
+.It Bq Er ENOTDIR
+The
+.Fa file
+argument specifies a relative path and the
+.Fa fd
+argument is a valid file descriptor but it does not reference a directory.
+.It Bq Er EACCES
+The
+.Fa file
+argument specifies a relative path but search permission is denied
+for the directory which the
+.Fa fd
+file descriptor references.
.El
.Pp
.Fn futimes