diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-11-05 17:55:50 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-11-05 17:55:50 +0000 |
commit | 342419a20106f45294d98630b17a27db567a0216 (patch) | |
tree | 23ab3e3f1c6c7ebf87ba10eb759e337c3313ab91 /lib/libc | |
parent | 5ac919c47ad79a78344523cf6cbc9595c9a4149b (diff) |
Move around the error cases to make clear that some don't apply to the
p* versions, as well as fix a couple other cases
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/sys/read.2 | 21 | ||||
-rw-r--r-- | lib/libc/sys/write.2 | 51 |
2 files changed, 45 insertions, 27 deletions
diff --git a/lib/libc/sys/read.2 b/lib/libc/sys/read.2 index 727c0df65e0..5c45a033967 100644 --- a/lib/libc/sys/read.2 +++ b/lib/libc/sys/read.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: read.2,v 1.28 2009/12/30 09:46:23 fgsch Exp $ +.\" $OpenBSD: read.2,v 1.29 2011/11/05 17:55:49 guenther Exp $ .\" $NetBSD: read.2,v 1.6 1995/02/27 12:35:47 cgd Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)read.2 8.4 (Berkeley) 2/26/94 .\" -.Dd $Mdocdate: December 30 2009 $ +.Dd $Mdocdate: November 5 2011 $ .Dt READ 2 .Os .Sh NAME @@ -151,8 +151,6 @@ will succeed unless: is not a valid file or socket descriptor open for reading. .It Bq Er EFAULT Part of -.Fa iov -or .Fa buf points outside the process's allocated address space. .It Bq Er EIO @@ -169,12 +167,19 @@ before any data arrived. The pointer associated with .Fa d was negative. +.El +.Pp +In addition, +.Fn read +and +.Fn readv +may return the following error: +.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. .El .Pp -In addition, .Fn read and .Fn pread @@ -193,7 +198,7 @@ may return the following error: .Bl -tag -width Er .It Bq Er ESPIPE .Fa d -is associated with a pipe, socket, or FIFO. +is associated with a pipe, socket, FIFO, or tty. .El .Pp .Fn readv @@ -212,6 +217,10 @@ values in the .Fa iov array overflowed an .Em ssize_t . +.It Bq Er EFAULT +Part of +.Fa iov +points outside the process's allocated address space. .El .Sh SEE ALSO .Xr dup 2 , diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2 index c7d124b03e4..75b16f040b4 100644 --- a/lib/libc/sys/write.2 +++ b/lib/libc/sys/write.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: write.2,v 1.33 2009/12/30 09:46:23 fgsch Exp $ +.\" $OpenBSD: write.2,v 1.34 2011/11/05 17:55:49 guenther Exp $ .\" $NetBSD: write.2,v 1.6 1995/02/27 12:39:43 cgd Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" -.Dd $Mdocdate: December 30 2009 $ +.Dd $Mdocdate: November 5 2011 $ .Dt WRITE 2 .Os .Sh NAME @@ -158,13 +158,6 @@ will fail and the file pointer will remain unchanged if: .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. @@ -179,13 +172,8 @@ 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 EAGAIN -The file was marked for non-blocking I/O, and no data could be -written immediately. .It Bq Er EFAULT Part of -.Fa iov -or .Fa buf points outside the process's allocated address space. .El @@ -193,6 +181,29 @@ points outside the process's allocated address space. In addition, .Fn write and +.Fn writev +may return the following error: +.Bl -tag -width Er +.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 EAGAIN +The file was marked for non-blocking I/O, and no data could be +written immediately. +.It Bq Er EDESTADDRREQ +The destination is no longer available when writing to a +.Ux Ns -domain +datagram socket on which +.Xr connect 2 +had been used to set a destination address. +.El +.Pp +.Fn write +and .Fn pwrite may return the following error: .Bl -tag -width Er @@ -209,7 +220,7 @@ may return the following error: .Bl -tag -width Er .It Bq Er ESPIPE .Fa d -is associated with a pipe, socket, or FIFO. +is associated with a pipe, socket, FIFO, or tty. .El .Pp .Fn writev @@ -217,12 +228,6 @@ and .Fn pwritev may return one of the following errors: .Bl -tag -width Er -.It Bq Er EDESTADDRREQ -The destination is no longer available when writing to a -.Ux Ns -domain -datagram socket on which -.Xr connect 2 -had been used to set a destination address. .It Bq Er EINVAL .Fa iovcnt was less than or equal to 0, or greater than @@ -234,6 +239,10 @@ values in the .Fa iov array overflowed an .Em ssize_t . +.It Bq Er EFAULT +Part of +.Fa iov +points outside the process's allocated address space. .It Bq Er ENOBUFS The system lacked sufficient buffer space or a queue was full. .El |