summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-04-08 06:26:13 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-04-08 06:26:13 +0000
commit5809e7fed4d5cf4018c41b560ebc907f3276ad22 (patch)
tree8848db09662d034b33fa36ac065fcd8518dd93bc
parent7da4231cf46cdb277efe551cf79c595ebe7086ec (diff)
Updates to SYNOPSIS, ERRORS, and STANDARDS.
-rw-r--r--lib/libc/sys/getsockopt.212
-rw-r--r--lib/libc/sys/gettimeofday.223
-rw-r--r--lib/libc/sys/listen.212
-rw-r--r--lib/libc/sys/read.234
-rw-r--r--lib/libc/sys/write.243
5 files changed, 84 insertions, 40 deletions
diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2
index 60b347561bc..582f9ffb9e5 100644
--- a/lib/libc/sys/getsockopt.2
+++ b/lib/libc/sys/getsockopt.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getsockopt.2,v 1.38 2013/01/18 09:41:51 bluhm Exp $
+.\" $OpenBSD: getsockopt.2,v 1.39 2013/04/08 06:26:12 guenther Exp $
.\" $NetBSD: getsockopt.2,v 1.7 1995/02/27 12:33:29 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)getsockopt.2 8.3 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: January 18 2013 $
+.Dd $Mdocdate: April 8 2013 $
.Dt GETSOCKOPT 2
.Os
.Sh NAME
@@ -38,7 +38,6 @@
.Nm setsockopt
.Nd get and set options on sockets
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
.Fn getsockopt "int s" "int level" "int optname" "void *optval" "socklen_t *optlen"
@@ -485,6 +484,13 @@ is not in a valid part of the process address space.
.Xr pf.conf 5 ,
.Xr protocols 5 ,
.Xr sosplice 9
+.Sh STANDARDS
+The
+.Fn getsockopt
+and
+.Fn setsockopt
+functions conform to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn getsockopt
diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2
index 8c3b0e5afe6..cf181b31ca5 100644
--- a/lib/libc/sys/gettimeofday.2
+++ b/lib/libc/sys/gettimeofday.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gettimeofday.2,v 1.21 2011/11/07 11:24:30 schwarze Exp $
+.\" $OpenBSD: gettimeofday.2,v 1.22 2013/04/08 06:26:12 guenther Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95
.\"
-.Dd $Mdocdate: November 7 2011 $
+.Dd $Mdocdate: April 8 2013 $
.Dt GETTIMEOFDAY 2
.Os
.Sh NAME
@@ -110,11 +110,19 @@ A \-1 return value indicates an error occurred, and in this
case an error code is stored into the global variable
.Va errno .
.Sh ERRORS
-The following error codes may be set in
-.Va errno :
-.Bl -tag -width [EFAULT]
+.Fn gettimeofday
+and
+.Fn settimeofday
+will succeed unless:
+.Bl -tag -width Er
.It Bq Er EFAULT
An argument address referenced invalid memory.
+.El
+.Pp
+In addition,
+.Fn settimeofday
+may return the following error:
+.Bl -tag -width Er
.It Bq Er EPERM
A user other than the superuser attempted to set the time.
.El
@@ -124,6 +132,11 @@ A user other than the superuser attempted to set the time.
.Xr getitimer 2 ,
.Xr ctime 3 ,
.Xr time 3
+.Sh STANDARDS
+The
+.Fn gettimeofday
+function conforms to
+.St -p1003.1-2008 .
.Sh HISTORY
As predecessors of these functions, former system calls
.Fn time
diff --git a/lib/libc/sys/listen.2 b/lib/libc/sys/listen.2
index 3d68c4aaf2a..4737803d799 100644
--- a/lib/libc/sys/listen.2
+++ b/lib/libc/sys/listen.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: listen.2,v 1.11 2010/04/14 22:43:34 millert Exp $
+.\" $OpenBSD: listen.2,v 1.12 2013/04/08 06:26:12 guenther Exp $
.\" $NetBSD: listen.2,v 1.7 1996/02/16 20:38:45 phil Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,14 +30,13 @@
.\"
.\" @(#)listen.2 8.2 (Berkeley) 12/11/93
.\"
-.Dd $Mdocdate: April 14 2010 $
+.Dd $Mdocdate: April 8 2013 $
.Dt LISTEN 2
.Os
.Sh NAME
.Nm listen
.Nd listen for connections on a socket
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
.Fn listen "int s" "int backlog"
@@ -85,12 +84,19 @@ is not a socket.
.It Bq Er EOPNOTSUPP
The socket is not of a type that supports the operation
.Fn listen .
+.It Bq Er EINVAL
+The socket is already connected.
.El
.Sh SEE ALSO
.Xr accept 2 ,
.Xr connect 2 ,
.Xr socket 2 ,
.Xr sysctl 8
+.Sh STANDARDS
+The
+.Fn listen
+function conforms to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn listen
diff --git a/lib/libc/sys/read.2 b/lib/libc/sys/read.2
index 3f9c585531d..b898d00d345 100644
--- a/lib/libc/sys/read.2
+++ b/lib/libc/sys/read.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: read.2,v 1.31 2011/11/06 17:22:20 schwarze Exp $
+.\" $OpenBSD: read.2,v 1.32 2013/04/08 06:26:12 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: November 6 2011 $
+.Dd $Mdocdate: April 8 2013 $
.Dt READ 2
.Os
.Sh NAME
@@ -40,18 +40,17 @@
.Nm preadv
.Nd read input
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <unistd.h>
.Ft ssize_t
.Fn read "int d" "void *buf" "size_t nbytes"
.Ft ssize_t
.Fn pread "int d" "void *buf" "size_t nbytes" "off_t offset"
.Pp
-.Fd #include <sys/types.h>
.Fd #include <sys/uio.h>
-.Fd #include <unistd.h>
.Ft ssize_t
.Fn readv "int d" "const struct iovec *iov" "int iovcnt"
+.Fd #include <sys/types.h>
+.Fd #include <sys/uio.h>
.Ft ssize_t
.Fn preadv "int d" "const struct iovec *iov" "int iovcnt" "off_t offset"
.Sh DESCRIPTION
@@ -154,10 +153,7 @@ Part of
.Fa buf
points outside the process's allocated address space.
.It Bq Er EIO
-An I/O error occurred while reading from the file system,
-or the process is a member of a background process attempting to read
-from its controlling terminal, the process is ignoring or blocking
-the SIGTTIN signal or the process group is orphaned.
+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)
@@ -169,11 +165,20 @@ In addition,
.Fn read
and
.Fn readv
-may return the following error:
+may return the following errors:
.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 ENOTCONN
+The file is a socket associated with a connection-oriented protocol
+and has not been connected.
+.It Bq Er EIO
+The process is a member of a background process attempting to read
+from its controlling terminal, the process is ignoring or blocking
+the
+.Dv SIGTTIN
+signal or the process group is orphaned.
.El
.Pp
.Fn read
@@ -232,15 +237,12 @@ points outside the process's allocated address space.
.Xr socketpair 2
.Sh STANDARDS
The
-.Fn read
-function conforms to
-.St -p1003.1-90 .
-The
-.Fn readv
+.Fn read ,
+.Fn readv ,
and
.Fn pread
functions conform to
-.St -xpg4.2 .
+.St -p1003.1-2008 .
.Sh HISTORY
A
.Fn read
diff --git a/lib/libc/sys/write.2 b/lib/libc/sys/write.2
index 11929c72c71..81f2068d30e 100644
--- a/lib/libc/sys/write.2
+++ b/lib/libc/sys/write.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: write.2,v 1.36 2013/03/09 21:05:29 tedu Exp $
+.\" $OpenBSD: write.2,v 1.37 2013/04/08 06:26:12 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: March 9 2013 $
+.Dd $Mdocdate: April 8 2013 $
.Dt WRITE 2
.Os
.Sh NAME
@@ -40,18 +40,17 @@
.Nm pwritev
.Nd write output
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <unistd.h>
.Ft ssize_t
.Fn write "int d" "const void *buf" "size_t nbytes"
.Ft ssize_t
.Fn pwrite "int d" "const void *buf" "size_t nbytes" "off_t offset"
.Pp
-.Fd #include <sys/types.h>
.Fd #include <sys/uio.h>
-.Fd #include <unistd.h>
.Ft ssize_t
.Fn writev "int d" "const struct iovec *iov" "int iovcnt"
+.Fd #include <sys/types.h>
+.Fd #include <sys/uio.h>
.Ft ssize_t
.Fn pwritev "int d" "const struct iovec *iov" "int iovcnt" "off_t offset"
.Sh DESCRIPTION
@@ -173,6 +172,11 @@ 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 EINTR
+A write to a slow device
+(i.e. one that might block for an arbitrary amount of time)
+was interrupted by the delivery of a signal
+before any data could be written.
.It Bq Er EIO
An I/O error occurred while reading from or writing to the file system.
.It Bq Er EFAULT
@@ -185,7 +189,7 @@ In addition,
.Fn write
and
.Fn writev
-may return the following error:
+may return the following errors:
.Bl -tag -width Er
.It Bq Er EPIPE
An attempt is made to write to a pipe that is not open
@@ -197,12 +201,27 @@ 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 ENETDOWN
+The destination address specified a network that is down.
.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 EIO
+The process is a member of a background process attempting to write
+to its controlling terminal,
+.Dv TOSTOP is set on the terminal,
+the process isn't ignoring the
+.Dv SIGTTOUT
+signal and the thread isn't blocking the
+.Dv SIGTTOUT
+signal,
+and either the process was created with
+.Xr vfork 2
+and hasn't successfully executed one of the exec functions or
+the process group is orphaned.
.El
.Pp
.Fn write
@@ -258,18 +277,16 @@ The system lacked sufficient buffer space or a queue was full.
.Xr open 2 ,
.Xr pipe 2 ,
.Xr poll 2 ,
-.Xr select 2
+.Xr select 2 ,
+.Xr termios 4
.Sh STANDARDS
The
-.Fn write
-function conforms to
-.St -p1003.1-90 .
-The
-.Fn writev
+.Fn write ,
+.Fn writev ,
and
.Fn pwrite
functions conform to
-.St -xpg4.2 .
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn pwritev