summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2013-03-31 08:34:27 +0000
committerguenther <guenther@openbsd.org>2013-03-31 08:34:27 +0000
commitd38222df7be226a2291431f4c21ea09b6b5ed074 (patch)
treec94f1fea2f67c54b3cac66c9a2d626af4965ac1d /lib/libc
parentLet the DDC "proxy" functions call the high-level I2C functions instead (diff)
downloadwireguard-openbsd-d38222df7be226a2291431f4c21ea09b6b5ed074.tar.xz
wireguard-openbsd-d38222df7be226a2291431f4c21ea09b6b5ed074.zip
Updates to SYNOPSIS, ERRORS, and STANDARDS
ok jmc@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/accept.212
-rw-r--r--lib/libc/sys/bind.218
-rw-r--r--lib/libc/sys/chdir.28
-rw-r--r--lib/libc/sys/clock_gettime.234
-rw-r--r--lib/libc/sys/close.29
-rw-r--r--lib/libc/sys/connect.216
-rw-r--r--lib/libc/sys/dup.227
7 files changed, 86 insertions, 38 deletions
diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2
index 30b9c874c42..67efb930373 100644
--- a/lib/libc/sys/accept.2
+++ b/lib/libc/sys/accept.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: accept.2,v 1.23 2012/04/24 12:20:59 jmc Exp $
+.\" $OpenBSD: accept.2,v 1.24 2013/03/31 08:34:27 guenther Exp $
.\" $NetBSD: accept.2,v 1.7 1996/01/31 20:14:42 mycroft Exp $
.\"
.\" Copyright (c) 1983, 1990, 1991, 1993
@@ -30,14 +30,13 @@
.\"
.\" @(#)accept.2 8.2 (Berkeley) 12/11/93
.\"
-.Dd $Mdocdate: April 24 2012 $
+.Dd $Mdocdate: March 31 2013 $
.Dt ACCEPT 2
.Os
.Sh NAME
.Nm accept
.Nd accept a connection on a socket
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
.Fn accept "int s" "struct sockaddr *addr" "socklen_t *addrlen"
@@ -158,7 +157,7 @@ will fail if:
.It Bq Er EBADF
The descriptor is invalid.
.It Bq Er ENOTSOCK
-The descriptor references a file, not a socket.
+The descriptor doesn't reference a socket.
.It Bq Er EOPNOTSUPP
The referenced socket is not of type
.Dv SOCK_STREAM .
@@ -191,6 +190,11 @@ A connection has been aborted.
.Xr poll 2 ,
.Xr select 2 ,
.Xr socket 2
+.Sh STANDARDS
+The
+.Fn accept
+function conforms to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn accept
diff --git a/lib/libc/sys/bind.2 b/lib/libc/sys/bind.2
index b47a0f69161..471470299fe 100644
--- a/lib/libc/sys/bind.2
+++ b/lib/libc/sys/bind.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bind.2,v 1.16 2009/12/29 10:25:43 sobrado Exp $
+.\" $OpenBSD: bind.2,v 1.17 2013/03/31 08:34:27 guenther Exp $
.\" $NetBSD: bind.2,v 1.8 1995/10/12 15:40:46 jtc Exp $
.\"
.\" Copyright (c) 1983, 1993
@@ -30,14 +30,13 @@
.\"
.\" @(#)bind.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: December 29 2009 $
+.Dd $Mdocdate: March 31 2013 $
.Dt BIND 2
.Os
.Sh NAME
.Nm bind
.Nd bind a name to a socket
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
.Fn bind "int s" "const struct sockaddr *name" "socklen_t namelen"
@@ -85,11 +84,15 @@ The specified address is not available from the local machine.
.It Bq Er EADDRINUSE
The specified address is already in use.
.It Bq Er EINVAL
-The socket is already bound to an address.
-.It Bq Er EINVAL
+The socket is already bound to an address, or
+.Fa namelen
+is not a valid length for the supplied address.
+.It Bq Er EAFNOSUPPORT
The family of the socket and that requested in
.Va name->sa_family
are not equivalent.
+.It Bq Er ENOBUFS
+Insufficient buffer space is available.
.It Bq Er EACCES
The requested address is protected, and the current user
has inadequate permission to access it.
@@ -126,6 +129,11 @@ An empty pathname was specified.
.Xr getsockname 2 ,
.Xr listen 2 ,
.Xr socket 2
+.Sh STANDARDS
+The
+.Fn bind
+function conforms to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn bind
diff --git a/lib/libc/sys/chdir.2 b/lib/libc/sys/chdir.2
index c745fbc0e7d..aad1fe8fd34 100644
--- a/lib/libc/sys/chdir.2
+++ b/lib/libc/sys/chdir.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: chdir.2,v 1.10 2011/11/06 17:22:20 schwarze Exp $
+.\" $OpenBSD: chdir.2,v 1.11 2013/03/31 08:34:27 guenther Exp $
.\" $NetBSD: chdir.2,v 1.7 1995/02/27 12:32:00 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)chdir.2 8.2 (Berkeley) 12/11/93
.\"
-.Dd $Mdocdate: November 6 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt CHDIR 2
.Os
.Sh NAME
@@ -93,7 +93,7 @@ Search permission is denied for any component of the pathname.
.Fa path
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.
+An I/O error occurred while reading from the file system.
.El
.Pp
.Fn fchdir
@@ -109,6 +109,8 @@ The file descriptor does not reference a directory.
The argument
.Fa fd
is not a valid file descriptor.
+.It Bq Er EIO
+An I/O error occurred while reading from the file system.
.El
.Sh SEE ALSO
.Xr chroot 2
diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2
index 7d14f4d8199..7d4adedb3c2 100644
--- a/lib/libc/sys/clock_gettime.2
+++ b/lib/libc/sys/clock_gettime.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: clock_gettime.2,v 1.19 2011/07/07 21:00:59 deraadt Exp $
+.\" $OpenBSD: clock_gettime.2,v 1.20 2013/03/31 08:34:27 guenther Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 7 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt CLOCK_GETTIME 2
.Os
.Sh NAME
@@ -36,7 +36,7 @@
.Nm clock_getres
.Nd get/set/calibrate date and time
.Sh SYNOPSIS
-.Fd #include <sys/time.h>
+.Fd #include <time.h>
.Ft int
.Fn clock_gettime "clockid_t clock_id" "struct timespec *tp"
.Ft int
@@ -98,19 +98,33 @@ 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 :
+.Fn clock_gettime ,
+.Fn clock_settime ,
+and
+.Fn clock_getres
+will fail if:
.Bl -tag -width Er
.It Bq Er EINVAL
-The
.Fa clock_id
-was not a valid value.
+is not a valid value.
.It Bq Er EFAULT
The
.Fa tp
argument address referenced invalid memory.
+.El
+.Pp
+In addition,
+.Fn clock_settime
+may return the following errors:
+.Bl -tag -width Er
.It Bq Er EPERM
A user other than the superuser attempted to set the time.
+.It Bq Er EINVAL
+.Fa clock_id
+specifies a clock that isn't settable,
+.Fa tp
+specifies a nanosecond value less than zero or greater than 1000 million,
+or a value outside the range of the specified clock.
.El
.Sh SEE ALSO
.Xr date 1 ,
@@ -118,9 +132,9 @@ A user other than the superuser attempted to set the time.
.Xr ctime 3
.Sh STANDARDS
The
+.Fn clock_getres ,
.Fn clock_gettime ,
-.Fn clock_settime ,
and
-.Fn clock_getres
+.Fn clock_settime
functions conform to
-.St -p1003.1b-93 .
+.St -p1003.1-2008 .
diff --git a/lib/libc/sys/close.2 b/lib/libc/sys/close.2
index 50feeb1fa08..cb233343a3a 100644
--- a/lib/libc/sys/close.2
+++ b/lib/libc/sys/close.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: close.2,v 1.15 2011/11/06 17:22:20 schwarze Exp $
+.\" $OpenBSD: close.2,v 1.16 2013/03/31 08:34:27 guenther Exp $
.\" $NetBSD: close.2,v 1.5 1995/02/27 12:32:14 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
@@ -30,7 +30,7 @@
.\"
.\" @(#)close.2 8.2 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: November 6 2011 $
+.Dd $Mdocdate: March 31 2013 $
.Dt CLOSE 2
.Os
.Sh NAME
@@ -116,10 +116,13 @@ will fail if:
is not an active descriptor.
.It Bq Er EINTR
An interrupt was received.
+.It Bq Er EIO
+An I/O error occurred while writing to the file system.
.El
.Sh SEE ALSO
.Xr accept 2 ,
.Xr closefrom 2 ,
+.Xr dup2 2 ,
.Xr execve 2 ,
.Xr fcntl 2 ,
.Xr flock 2 ,
@@ -130,7 +133,7 @@ An interrupt was received.
.Sh STANDARDS
.Fn close
conforms to
-.St -p1003.1-88 .
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn close
diff --git a/lib/libc/sys/connect.2 b/lib/libc/sys/connect.2
index 2869bb5ddae..99d525e2a2d 100644
--- a/lib/libc/sys/connect.2
+++ b/lib/libc/sys/connect.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: connect.2,v 1.22 2009/12/29 10:25:43 sobrado Exp $
+.\" $OpenBSD: connect.2,v 1.23 2013/03/31 08:34:27 guenther Exp $
.\" $NetBSD: connect.2,v 1.8 1995/10/12 15:40:48 jtc Exp $
.\"
.\" Copyright (c) 1983, 1993
@@ -30,14 +30,13 @@
.\"
.\" @(#)connect.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: December 29 2009 $
+.Dd $Mdocdate: March 31 2013 $
.Dt CONNECT 2
.Os
.Sh NAME
.Nm connect
.Nd initiate a connection on a socket
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
.Fn connect "int s" "const struct sockaddr *name" "socklen_t namelen"
@@ -82,11 +81,11 @@ The
call fails if:
.Bl -tag -width Er
.It Bq Er EBADF
-.Fa S
+.Fa s
is not a valid descriptor.
.It Bq Er ENOTSOCK
-.Fa S
-is a descriptor for a file, not a socket.
+.Fa s
+is not a socket.
.It Bq Er EADDRNOTAVAIL
The specified address is not available on this machine.
.It Bq Er EAFNOSUPPORT
@@ -176,6 +175,11 @@ may refer to a socket of type
.Xr poll 2 ,
.Xr select 2 ,
.Xr socket 2
+.Sh STANDARDS
+The
+.Fn connect
+function conforms to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn connect
diff --git a/lib/libc/sys/dup.2 b/lib/libc/sys/dup.2
index 19ce34b511f..e0cb083b3f4 100644
--- a/lib/libc/sys/dup.2
+++ b/lib/libc/sys/dup.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dup.2,v 1.14 2013/03/30 06:44:44 guenther Exp $
+.\" $OpenBSD: dup.2,v 1.15 2013/03/31 08:34:27 guenther Exp $
.\" $NetBSD: dup.2,v 1.4 1995/02/27 12:32:21 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)dup.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: March 30 2013 $
+.Dd $Mdocdate: March 31 2013 $
.Dt DUP 2
.Os
.Sh NAME
@@ -104,22 +104,35 @@ The external variable
indicates the cause of the error.
.Sh ERRORS
.Fn dup
-and
-.Fn dup2
-fail if:
+will fail if:
.Bl -tag -width Er
.It Bq Er EBADF
.Fa oldd
-or
-.Fa newd
is not a valid active descriptor.
.It Bq Er EMFILE
Too many descriptors are active.
.El
+.Pp
+.Fn dup2
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+.Fa oldd
+is not a valid active descriptor or
+.Fa newd
+is negative or greater than or equal to the process's
+.Dv RLIMIT_NOFILE
+limit.
+.It Bq Er EINTR
+An interrupt was received.
+.It Bq Er EIO
+An I/O error occurred while writing to the file system.
+.El
.Sh SEE ALSO
.Xr accept 2 ,
.Xr close 2 ,
.Xr fcntl 2 ,
+.Xr getrlimit 2 ,
.Xr open 2 ,
.Xr pipe 2 ,
.Xr socket 2 ,