summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/recv.235
-rw-r--r--lib/libc/sys/send.250
-rw-r--r--lib/libc/sys/setuid.258
-rw-r--r--lib/libc/sys/wait.216
4 files changed, 101 insertions, 58 deletions
diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2
index 14fe706d196..4ec9ee50e6e 100644
--- a/lib/libc/sys/recv.2
+++ b/lib/libc/sys/recv.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: recv.2,v 1.41 2014/08/31 01:42:36 guenther Exp $
+.\" $OpenBSD: recv.2,v 1.42 2014/09/09 06:32:37 guenther Exp $
.\" $NetBSD: recv.2,v 1.6 1995/02/27 12:36:08 cgd Exp $
.\"
.\" Copyright (c) 1983, 1990, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)recv.2 8.3 (Berkeley) 2/21/94
.\"
-.Dd $Mdocdate: August 31 2014 $
+.Dd $Mdocdate: September 9 2014 $
.Dt RECV 2
.Os
.Sh NAME
@@ -291,6 +291,10 @@ A socket operation failed
because the destination host was down.
.It Bq Er ENETDOWN
A socket operation encountered a dead network.
+.It Bq Er ECONNREFUSED
+The socket is associated with a connection-oriented protocol
+and the connection was forcefully rejected (see
+.Xr connect 2 ) .
.El
.Pp
In addition,
@@ -305,16 +309,6 @@ was larger than
.Dv SSIZE_MAX .
.El
.Pp
-Also,
-.Fn recv
-may return the following error:
-.Bl -tag -width "[ECONNREFUSED]"
-.It Bq Er ECONNREFUSED
-The socket is associated with a connection-oriented protocol
-and the connection was forcefully rejected (see
-.Xr connect 2 ) .
-.El
-.Pp
And
.Fn recvmsg
may return one of the following errors:
@@ -350,7 +344,22 @@ by another call to
.Xr select 2 ,
.Xr socket 2 ,
.Xr socketpair 2 ,
-.Xr CMSG_DATA 3
+.Xr CMSG_DATA 3 ,
+.Xr sockatmark 3
+.Sh STANDARDS
+The
+.Fn recv ,
+.Fn recvfrom ,
+and
+.Fn recvmsg
+functions conform to
+.St -p1003.1-2008 .
+The
+.Dv MSG_DONTWAIT ,
+.Dv MSG_BCAST ,
+and
+.Dv MSG_MCAST
+flags are extensions to that specification.
.Sh HISTORY
The
.Fn recv
diff --git a/lib/libc/sys/send.2 b/lib/libc/sys/send.2
index 93d2436bfe6..6db1ed64ada 100644
--- a/lib/libc/sys/send.2
+++ b/lib/libc/sys/send.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: send.2,v 1.30 2014/04/07 10:04:17 mpi Exp $
+.\" $OpenBSD: send.2,v 1.31 2014/09/09 06:32:37 guenther Exp $
.\" $NetBSD: send.2,v 1.6 1996/01/15 01:17:18 thorpej Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)send.2 8.2 (Berkeley) 2/21/94
.\"
-.Dd $Mdocdate: April 7 2014 $
+.Dd $Mdocdate: September 9 2014 $
.Dt SEND 2
.Os
.Sh NAME
@@ -39,8 +39,7 @@
.Nm sendmsg
.Nd send a message from a socket
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <sys/socket.h>
+.In sys/socket.h
.Ft ssize_t
.Fn send "int s" "const void *msg" "size_t len" "int flags"
.Ft ssize_t
@@ -96,15 +95,17 @@ The
parameter may include one or more of the following:
.Pp
.Bl -tag -width "MSG_DONTROUTEXX" -offset indent -compact
-.It Dv MSG_OOB
-process out-of-band data
.It Dv MSG_DONTROUTE
bypass routing tables, silently ignored
+.It Dv MSG_DONTWAIT
+don't block
+.It Dv MSG_EOR
+terminate the record (SOCK_SEQPACKET only)
.It Dv MSG_NOSIGNAL
don't send
.Dv SIGPIPE
-.It Dv MSG_DONTWAIT
-don't block
+.It Dv MSG_OOB
+process out-of-band data
.El
.Pp
The flag
@@ -149,7 +150,9 @@ An invalid user space address was specified for a parameter.
The socket requires that message be sent atomically,
and the size of the message to be sent made this impossible.
.It Bq Er EAGAIN
-The socket is marked non-blocking and the requested operation
+The socket is marked non-blocking or the
+.Dv MSG_DONTWAIT
+flag is set and the requested operation
would block.
.It Bq Er ENOBUFS
The system was unable to allocate an internal buffer.
@@ -181,8 +184,6 @@ There was a problem sending the message.
This error can only be returned by connected sockets.
.It Bq Er EDESTADDRREQ
The socket is not connected, and no destination address was specified.
-.It Bq Er EISCONN
-The socket is already connected, and a destination address was specified.
.It Bq Er EPIPE
The socket is shut down for writing or not longer connected and the
.Dv MSG_NOSIGNAL
@@ -201,7 +202,17 @@ was larger than
.Dv SSIZE_MAX .
.El
.Pp
-Also,
+.Fn sendto
+and
+.Fn sendmsg
+may return the following errors:
+.Bl -tag -width Er
+.It Bq Er EAFNOSUPPORT
+Addresses in the specified address family cannot be used with this socket.
+.It Bq Er EISCONN
+The socket is already connected, and a destination address was specified.
+.El
+.Pp
.Fn sendmsg
may return the following errors:
.Bl -tag -width Er
@@ -219,8 +230,6 @@ member of
.Fa msg
was less than 0 or larger than
.Dv IOV_MAX .
-.It Bq Er EAFNOSUPPORT
-Addresses in the specified address family cannot be used with this socket.
.It Bq Er EMFILE
The message contains control information utilizing
.Xr CMSG_DATA 3
@@ -236,6 +245,19 @@ are already in-flight.
.Xr socket 2 ,
.Xr write 2 ,
.Xr CMSG_DATA 3
+.Sh STANDARDS
+The
+.Fn send ,
+.Fn sendto ,
+and
+.Fn sendmsg
+functions conform to
+.St -p1003.1-2008 .
+The
+.Dv MSG_DONTWAIT
+and
+.Dv MSG_NOSIGNAL
+flags are extensions to that specification.
.Sh HISTORY
The
.Fn send
diff --git a/lib/libc/sys/setuid.2 b/lib/libc/sys/setuid.2
index cb9f7d76809..cb6b9c2b751 100644
--- a/lib/libc/sys/setuid.2
+++ b/lib/libc/sys/setuid.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: setuid.2,v 1.21 2011/11/07 11:24:30 schwarze Exp $
+.\" $OpenBSD: setuid.2,v 1.22 2014/09/09 06:32:37 guenther Exp $
.\" $NetBSD: setuid.2,v 1.3 1995/02/27 12:37:06 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)setuid.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: November 7 2011 $
+.Dd $Mdocdate: September 9 2014 $
.Dt SETUID 2
.Os
.Sh NAME
@@ -40,8 +40,7 @@
.Nm setegid
.Nd set user and group ID
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
-.Fd #include <unistd.h>
+.In unistd.h
.Ft int
.Fn setuid "uid_t uid"
.Ft int
@@ -92,12 +91,33 @@ by reverting to the set-user-ID value.
Similarly, the effective group ID may be set to the value
of the real group ID or the saved set-group-ID.
.Sh RETURN VALUES
-Upon success, these functions return 0;
-otherwise \-1 is returned.
+.Rv -std setuid seteuid setgid setegid
+.Sh ERRORS
+.Fn setuid
+and
+.Fn seteuid ,
+will succeed unless:
+.Bl -tag -width Er
+.It Bq Er EPERM
+The user is not the superuser and the requested
+.Fa uid
+or
+.Fa euid
+is not the process's real, effective, or saved UID.
+.El
.Pp
-If the user is not the superuser, or the UID
-specified is not the real, effective, or saved ID,
-these functions return \-1.
+.Fn setgid
+and
+.Fn setegid
+will succeed unless:
+.Bl -tag -width Er
+.It Bq Er EPERM
+The user is not the superuser and the requested
+.Fa gid
+or
+.Fa egid
+is not the process's real, effective, or saved GID.
+.El
.Sh SEE ALSO
.Xr getgid 2 ,
.Xr getuid 2 ,
@@ -109,23 +129,13 @@ these functions return \-1.
.Xr setreuid 2
.Sh STANDARDS
The
-.Fn setuid
-and
-.Fn setgid
-functions are compliant with the
-.St -p1003.1-90
-specification with
-.Li _POSIX_SAVED_IDS
-defined, with the extensions allowed in section B.4.2.2.
-The
-.Fn seteuid
+.Fn setuid ,
+.Fn seteuid ,
+.Fn setgid ,
and
.Fn setegid
-functions are extensions based on the
-.Tn POSIX
-concept of
-.Li _POSIX_SAVED_IDS ,
-and have been proposed for a future revision of the standard.
+functions conform to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn setuid
diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2
index b18db3b0d9c..c1e8cfe01c1 100644
--- a/lib/libc/sys/wait.2
+++ b/lib/libc/sys/wait.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: wait.2,v 1.26 2014/02/13 07:30:39 guenther Exp $
+.\" $OpenBSD: wait.2,v 1.27 2014/09/09 06:32:37 guenther Exp $
.\" $NetBSD: wait.2,v 1.6 1995/02/27 12:39:37 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
@@ -30,7 +30,7 @@
.\"
.\" @(#)wait.2 8.2 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: February 13 2014 $
+.Dd $Mdocdate: September 9 2014 $
.Dt WAIT 2
.Os
.Sh NAME
@@ -40,13 +40,13 @@
.Nm wait3
.Nd wait for process termination
.Sh SYNOPSIS
-.Fd #include <sys/wait.h>
+.In sys/wait.h
.Ft pid_t
.Fn wait "int *status"
.Ft pid_t
.Fn waitpid "pid_t wpid" "int *status" "int options"
-.Fd #include <sys/resource.h>
-.Fd #include <sys/wait.h>
+.In sys/resource.h
+.In sys/wait.h
.Ft pid_t
.Fn wait3 "int *status" "int options" "struct rusage *rusage"
.Ft pid_t
@@ -283,7 +283,9 @@ The
.Fn wait
and
.Fn waitpid
-functions are defined by POSIX;
+functions conform to
+.St -p1003.1-2008 .
+.Pp
.Fn wait4
and
.Fn wait3
@@ -292,7 +294,7 @@ The
.Fn WCOREDUMP
macro and the ability to restart a pending
.Fn wait
-call are extensions to the POSIX interface.
+call are extensions to that specification.
.Sh HISTORY
A
.Fn wait