Module Name: src
Committed By: wiz
Date: Mon Apr 5 07:53:47 UTC 2010
Modified Files:
src/lib/libc/sys: acct.2 lseek.2 open.2 read.2 unlink.2 write.2
Log Message:
Sort ERRORS section.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/sys/acct.2
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/sys/lseek.2
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/sys/open.2
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/sys/read.2
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/sys/unlink.2
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/write.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/acct.2
diff -u src/lib/libc/sys/acct.2:1.17 src/lib/libc/sys/acct.2:1.18
--- src/lib/libc/sys/acct.2:1.17 Sat Apr 3 14:40:34 2010
+++ src/lib/libc/sys/acct.2 Mon Apr 5 07:53:47 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acct.2,v 1.17 2010/04/03 14:40:34 jruoho Exp $
+.\" $NetBSD: acct.2,v 1.18 2010/04/05 07:53:47 wiz Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -86,10 +86,16 @@
.Fn acct
will fail if one of the following is true:
.Bl -tag -width Er
-.It Bq Er EPERM
-The caller is not the super-user.
-.It Bq Er ENOTDIR
-A component of the path prefix is not a directory.
+.It Bq Er EACCES
+Search permission is denied for a component of the path prefix,
+or the path name is not a regular file.
+.It Bq Er EFAULT
+.Fa file
+points outside the process's allocated address space.
+.It Bq Er EIO
+An I/O error occurred while reading from or writing to the file system.
+.It Bq Er ELOOP
+Too many symbolic links were encountered in translating the pathname.
.It Bq Er ENAMETOOLONG
A component of a pathname exceeded
.Dv {NAME_MAX}
@@ -98,18 +104,12 @@
characters.
.It Bq Er ENOENT
The named file does not exist.
-.It Bq Er EACCES
-Search permission is denied for a component of the path prefix,
-or the path name is not a regular file.
-.It Bq Er ELOOP
-Too many symbolic links were encountered in translating the pathname.
+.It Bq Er ENOTDIR
+A component of the path prefix is not a directory.
+.It Bq Er EPERM
+The caller is not the super-user.
.It Bq Er EROFS
The named file resides on a read-only file system.
-.It Bq Er EFAULT
-.Fa file
-points outside the process's allocated address space.
-.It Bq Er EIO
-An I/O error occurred while reading from or writing to the file system.
.El
.Pp
Also,
Index: src/lib/libc/sys/lseek.2
diff -u src/lib/libc/sys/lseek.2:1.23 src/lib/libc/sys/lseek.2:1.24
--- src/lib/libc/sys/lseek.2:1.23 Sat Apr 3 15:42:22 2010
+++ src/lib/libc/sys/lseek.2 Mon Apr 5 07:53:47 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: lseek.2,v 1.23 2010/04/03 15:42:22 jruoho Exp $
+.\" $NetBSD: lseek.2,v 1.24 2010/04/05 07:53:47 wiz Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -115,12 +115,12 @@
.It Bq Er EBADF
.Fa fildes
is not an open file descriptor.
-.It Bq Er ESPIPE
-.Fa fildes
-is associated with a pipe, socket, or FIFO.
.It Bq Er EINVAL
.Fa whence
is not a proper value, or the resulting file offset would be invalid.
+.It Bq Er ESPIPE
+.Fa fildes
+is associated with a pipe, socket, or FIFO.
.El
.Sh SEE ALSO
.Xr dup 2 ,
Index: src/lib/libc/sys/open.2
diff -u src/lib/libc/sys/open.2:1.40 src/lib/libc/sys/open.2:1.41
--- src/lib/libc/sys/open.2:1.40 Sat Apr 3 15:48:52 2010
+++ src/lib/libc/sys/open.2 Mon Apr 5 07:53:47 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: open.2,v 1.40 2010/04/03 15:48:52 jruoho Exp $
+.\" $NetBSD: open.2,v 1.41 2010/04/05 07:53:47 wiz Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -228,22 +228,6 @@
.Sh ERRORS
The named file is opened unless:
.Bl -tag -width Er
-.It Bq Er EPERM
-The file's flags (see
-.Xr chflags 2 )
-don't allow the file to be opened.
-.It Bq Er ENOTDIR
-A component of the path prefix is not a directory.
-.It Bq Er ENAMETOOLONG
-A component of a pathname exceeded
-.Dv NAME_MAX
-characters, or an entire path name exceeded
-.Dv PATH_MAX
-characters.
-.It Bq Er ENOENT
-.Dv O_CREAT
-is not set and the named file does not exist, or
-a component of the path name that must exist does not exist.
.It Bq Er EACCES
Search permission is denied for a component of the path prefix,
the required permissions (for reading and/or writing)
@@ -253,18 +237,68 @@
the file does not exist,
and the directory in which it is to be created
does not permit writing.
-.It Bq Er ELOOP
-Too many symbolic links were encountered in translating the pathname.
+.It Bq Er EDQUOT
+.Dv O_CREAT
+is specified,
+the file does not exist,
+and the directory in which the entry for the new file
+is being placed cannot be extended because the
+user's quota of disk blocks on the file system
+containing the directory has been exhausted; or
+.Dv O_CREAT
+is specified,
+the file does not exist,
+and the user's quota of inodes on the file system on
+which the file is being created has been exhausted.
+.It Bq Er EEXIST
+.Dv O_CREAT
+and
+.Dv O_EXCL
+were specified and the file exists.
+.It Bq Er EFAULT
+.Fa path
+points outside the process's allocated address space.
+.It Bq Er EINTR
+The
+.Fn open
+operation was interrupted by a signal.
+.It Bq Er EIO
+An I/O error occurred while making the directory entry or
+allocating the inode for
+.Dv O_CREAT .
.It Bq Er EISDIR
The named file is a directory, and the arguments specify
it is to be opened for writing.
-.It Bq Er EROFS
-The named file resides on a read-only file system,
-and the file is to be modified.
+.It Bq Er ELOOP
+Too many symbolic links were encountered in translating the pathname.
.It Bq Er EMFILE
The process has already reached its limit for open file descriptors.
+.It Bq Er ENAMETOOLONG
+A component of a pathname exceeded
+.Dv NAME_MAX
+characters, or an entire path name exceeded
+.Dv PATH_MAX
+characters.
+.It Bq Er ENOENT
+.Dv O_CREAT
+is not set and the named file does not exist, or
+a component of the path name that must exist does not exist.
.It Bq Er ENFILE
The system file table is full.
+.It Bq Er ENOSPC
+.Dv O_CREAT
+is specified,
+the file does not exist,
+and the directory in which the entry for the new file is being placed
+cannot be extended because there is no space left on the file
+system containing the directory; or
+.Dv O_CREAT
+is specified,
+the file does not exist,
+and there are no free inodes on the file system on which the
+file is being created.
+.It Bq Er ENOTDIR
+A component of the path prefix is not a directory.
.It Bq Er ENXIO
The named file is a character special or block
special file, and the device associated with this special file
@@ -275,61 +309,24 @@
and
.Dv O_WRONLY
is set and no process has the file open for reading.
-.It Bq Er EINTR
-The
-.Fn open
-operation was interrupted by a signal.
.It Bq Er EOPNOTSUPP
.Dv O_SHLOCK
or
.Dv O_EXLOCK
-is specified but the underlying filesystem does not support locking.
-.It Bq Er ENOSPC
-.Dv O_CREAT
-is specified,
-the file does not exist,
-and the directory in which the entry for the new file is being placed
-cannot be extended because there is no space left on the file
-system containing the directory.
-.It Bq Er ENOSPC
-.Dv O_CREAT
-is specified,
-the file does not exist,
-and there are no free inodes on the file system on which the
-file is being created.
-.It Bq Er EDQUOT
-.Dv O_CREAT
-is specified,
-the file does not exist,
-and the directory in which the entry for the new file
-is being placed cannot be extended because the
-user's quota of disk blocks on the file system
-containing the directory has been exhausted.
-.It Bq Er EDQUOT
-.Dv O_CREAT
-is specified,
-the file does not exist,
-and the user's quota of inodes on the file system on
-which the file is being created has been exhausted.
-.It Bq Er EIO
-An I/O error occurred while making the directory entry or
-allocating the inode for
-.Dv O_CREAT .
+is specified but the underlying filesystem does not support locking; or
+an attempt was made to open a socket (not currently implemented).
+.It Bq Er EPERM
+The file's flags (see
+.Xr chflags 2 )
+don't allow the file to be opened.
+.It Bq Er EROFS
+The named file resides on a read-only file system,
+and the file is to be modified.
.It Bq Er ETXTBSY
The file is a pure procedure (shared text) file that is being
executed and the
.Fn open
call requests write access.
-.It Bq Er EFAULT
-.Fa path
-points outside the process's allocated address space.
-.It Bq Er EEXIST
-.Dv O_CREAT
-and
-.Dv O_EXCL
-were specified and the file exists.
-.It Bq Er EOPNOTSUPP
-An attempt was made to open a socket (not currently implemented).
.El
.Sh SEE ALSO
.Xr chmod 2 ,
Index: src/lib/libc/sys/read.2
diff -u src/lib/libc/sys/read.2:1.32 src/lib/libc/sys/read.2:1.33
--- src/lib/libc/sys/read.2:1.32 Sat Apr 3 15:43:46 2010
+++ src/lib/libc/sys/read.2 Mon Apr 5 07:53:47 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: read.2,v 1.32 2010/04/03 15:43:46 jruoho Exp $
+.\" $NetBSD: read.2,v 1.33 2010/04/05 07:53:47 wiz Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -135,14 +135,15 @@
.Fn preadv
will succeed unless:
.Bl -tag -width Er
+.It Bq Er EAGAIN
+The file was marked for non-blocking I/O,
+and no data were ready to be read.
.It Bq Er EBADF
.Fa d
is not a valid file or socket descriptor open for reading.
.It Bq Er EFAULT
.Fa buf
points outside the allocated address space.
-.It Bq Er EIO
-An I/O error occurred while reading from the file system.
.It Bq Er EINTR
A read from a slow device
(i.e. one that might block for an arbitrary amount of time)
@@ -155,13 +156,11 @@
.It Bq Er EINVAL
The file pointer associated with
.Fa d
-was negative.
-.It Bq Er EINVAL
-The total length of the I/O is more than can be expressed by the ssize_t
+was negative; or
+the total length of the I/O is more than can be expressed by the ssize_t
return value.
-.It Bq Er EAGAIN
-The file was marked for non-blocking I/O,
-and no data were ready to be read.
+.It Bq Er EIO
+An I/O error occurred while reading from the file system.
.El
.Pp
In addition,
@@ -170,26 +169,24 @@
.Fn preadv
may return one of the following errors:
.Bl -tag -width Er
+.It Bq Er EFAULT
+Part of the
+.Fa iov
+points outside the process's allocated address space.
.It Bq Er EINVAL
.Fa iovcnt
was less than or equal to 0, or greater than
-.Dv {IOV_MAX} .
-.It Bq Er EINVAL
-One of the
+.Dv {IOV_MAX} ;
+or one of the
.Fa iov_len
values in the
.Fa iov
-array was negative.
-.It Bq Er EINVAL
-The sum of the
+array was negative; or
+the sum of the
.Fa iov_len
values in the
.Fa iov
array overflowed a 32-bit integer.
-.It Bq Er EFAULT
-Part of the
-.Fa iov
-points outside the process's allocated address space.
.El
.Pp
The
Index: src/lib/libc/sys/unlink.2
diff -u src/lib/libc/sys/unlink.2:1.21 src/lib/libc/sys/unlink.2:1.22
--- src/lib/libc/sys/unlink.2:1.21 Sat Apr 3 15:35:06 2010
+++ src/lib/libc/sys/unlink.2 Mon Apr 5 07:53:47 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: unlink.2,v 1.21 2010/04/03 15:35:06 jruoho Exp $
+.\" $NetBSD: unlink.2,v 1.22 2010/04/05 07:53:47 wiz Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -66,8 +66,21 @@
.Fn unlink
succeeds unless:
.Bl -tag -width Er
-.It Bq Er ENOTDIR
-A component of the path prefix is not a directory.
+.It Bq Er EACCES
+Search permission is denied for a component of the path prefix, or
+write permission is denied on the directory containing the link
+to be removed.
+.It Bq Er EBUSY
+The entry to be unlinked is the mount point for a
+mounted file system.
+.It Bq Er EFAULT
+.Fa path
+points outside the process's allocated address space.
+.It Bq Er EIO
+An I/O error occurred while deleting the directory entry
+or deallocating the inode.
+.It Bq Er ELOOP
+Too many symbolic links were encountered in translating the pathname.
.It Bq Er ENAMETOOLONG
A component of a pathname exceeded
.Dv {NAME_MAX}
@@ -76,12 +89,8 @@
characters.
.It Bq Er ENOENT
The named file does not exist.
-.It Bq Er EACCES
-Search permission is denied for a component of the path prefix, or
-write permission is denied on the directory containing the link
-to be removed.
-.It Bq Er ELOOP
-Too many symbolic links were encountered in translating the pathname.
+.It Bq Er ENOTDIR
+A component of the path prefix is not a directory.
.It Bq Er EPERM
The named file is a directory and the effective user ID
of the process is not the super-user, the file system
@@ -91,17 +100,8 @@
or the directory containing the file is marked sticky,
and neither the containing directory nor the file to be removed
are owned by the effective user ID.
-.It Bq Er EBUSY
-The entry to be unlinked is the mount point for a
-mounted file system.
-.It Bq Er EIO
-An I/O error occurred while deleting the directory entry
-or deallocating the inode.
.It Bq Er EROFS
The named file resides on a read-only file system.
-.It Bq Er EFAULT
-.Fa path
-points outside the process's allocated address space.
.El
.Sh SEE ALSO
.Xr close 2 ,
Index: src/lib/libc/sys/write.2
diff -u src/lib/libc/sys/write.2:1.31 src/lib/libc/sys/write.2:1.32
--- src/lib/libc/sys/write.2:1.31 Sat Apr 3 15:43:46 2010
+++ src/lib/libc/sys/write.2 Mon Apr 5 07:53:47 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: write.2,v 1.31 2010/04/03 15:43:46 jruoho Exp $
+.\" $NetBSD: write.2,v 1.32 2010/04/05 07:53:47 wiz Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -150,39 +150,23 @@
.Fn pwritev
will fail and the file pointer will remain unchanged if:
.Bl -tag -width Er
+.It Bq Er EAGAIN
+The file was marked for non-blocking I/O,
+and no data could be written immediately.
.It Bq Er EBADF
.Fa d
is not a valid descriptor open for writing.
-.It Bq Er EPIPE
-An attempt is made to write to a pipe that is not open
-for reading by any process.
-.It Bq Er EPIPE
-An attempt is made to write to a socket of type
-.Dv SOCK_STREAM
-that is not connected to a peer socket.
-.It Bq Er EFBIG
-An attempt was made to write a file that exceeds the process's
-file size limit or the maximum file size.
+.It Bq Er EDQUOT
+The user's quota of disk blocks on the file system
+containing the file has been exhausted.
.It Bq Er EFAULT
Part of
.Fa iov
or data to be written to the file
points outside the process's allocated address space.
-.It Bq Er EINVAL
-The pointer associated with
-.Fa d
-was negative.
-.It Bq Er EINVAL
-The total length of the I/O is more than can be expressed by the ssize_t
-return value.
-.It Bq Er ENOSPC
-There is no free space remaining on the file system
-containing the file.
-.It Bq Er EDQUOT
-The user's quota of disk blocks on the file system
-containing the file has been exhausted.
-.It Bq Er EIO
-An I/O error occurred while reading from or writing to the file system.
+.It Bq Er EFBIG
+An attempt was made to write a file that exceeds the process's
+file size limit or the maximum file size.
.It Bq Er EINTR
A signal was received before any data could be written to a slow
device.
@@ -190,9 +174,23 @@
.Xr sigaction 2
for more information on the interaction between signals and system
calls.
-.It Bq Er EAGAIN
-The file was marked for non-blocking I/O,
-and no data could be written immediately.
+.It Bq Er EINVAL
+The pointer associated with
+.Fa d
+was negative; or
+the total length of the I/O is more than can be expressed by the ssize_t
+return value.
+.It Bq Er EIO
+An I/O error occurred while reading from or writing to the file system.
+.It Bq Er ENOSPC
+There is no free space remaining on the file system
+containing the file.
+.It Bq Er EPIPE
+An attempt is made to write to a pipe that is not open
+for reading by any process; or
+an attempt is made to write to a socket of type
+.Dv SOCK_STREAM
+that is not connected to a peer socket.
.El
.Pp
In addition,
@@ -204,15 +202,13 @@
.It Bq Er EINVAL
.Fa iovcnt
was less than or equal to 0, or greater than
-.Dv {IOV_MAX} .
-.It Bq Er EINVAL
-One of the
+.Dv {IOV_MAX} ;
+or one of the
.Fa iov_len
values in the
.Fa iov
-array was negative.
-.It Bq Er EINVAL
-The sum of the
+array was negative; or
+the sum of the
.Fa iov_len
values in the
.Fa iov