summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2019-07-18 12:57:12 +0000
committerschwarze <schwarze@openbsd.org>2019-07-18 12:57:12 +0000
commit85f09f86efca3fb4315e2cb4b11ca047a2df61bf (patch)
tree7ddba475ae555ca4e8ad60b1cb83001270f340ad
parentMake indentation consistent. This has been bugging me for a while now. (diff)
downloadwireguard-openbsd-85f09f86efca3fb4315e2cb4b11ca047a2df61bf.tar.xz
wireguard-openbsd-85f09f86efca3fb4315e2cb4b11ca047a2df61bf.zip
State that mtype < 1 causes EINVAL as required by POSIX
and as implemented by OpenBSD since sysv_msg.c rev. 1.35. Diff from Moritz Buhl <mbuhl at moritzbuhl dot de> requested by bluhm@. While here, add STANDARDS, improve HISTORY, and use the customary .Fa for struct fields rather than .Va.
-rw-r--r--lib/libc/sys/msgsnd.234
1 files changed, 22 insertions, 12 deletions
diff --git a/lib/libc/sys/msgsnd.2 b/lib/libc/sys/msgsnd.2
index 82523cd22a9..3b676f4ede9 100644
--- a/lib/libc/sys/msgsnd.2
+++ b/lib/libc/sys/msgsnd.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: msgsnd.2,v 1.19 2014/12/10 19:19:00 schwarze Exp $
+.\" $OpenBSD: msgsnd.2,v 1.20 2019/07/18 12:57:12 schwarze Exp $
.\" $NetBSD: msgsnd.2,v 1.2 1997/03/27 08:20:36 mikel Exp $
.\"
.\" Copyright (c) 1995 Frank van der Linden
@@ -30,7 +30,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"/
-.Dd $Mdocdate: December 10 2014 $
+.Dd $Mdocdate: July 18 2019 $
.Dt MSGSND 2
.Os
.Sh NAME
@@ -53,10 +53,10 @@ long mtype; /* message type */
char mtext[1]; /* body of message */
.Ed
.Pp
-.Va mtype
+.Fa mtype
is an integer greater than 0 that can be used for selecting messages (see
.Xr msgrcv 2 ) ;
-.Va mtext
+.Fa mtext
is an array of
.Fa msgsz
bytes, with a size between 0 and that of the system limit
@@ -65,7 +65,7 @@ bytes, with a size between 0 and that of the system limit
If the number of bytes already on the message queue plus
.Fa msgsz
is bigger than the maximum number of bytes on the message queue
-.Po Va msg_qbytes ,
+.Po Fa msg_qbytes ,
see
.Xr msgctl 2
.Pc ,
@@ -105,16 +105,16 @@ After a successful call, the data structure associated with the message
queue is updated in the following way:
.Bl -bullet
.It
-.Va msg_cbytes
+.Fa msg_cbytes
is incremented by the size of the message.
.It
-.Va msg_qnum
+.Fa msg_qnum
is incremented by 1.
.It
-.Va msg_lspid
+.Fa msg_lspid
is set to the pid of the calling process.
.It
-.Va msg_stime
+.Fa msg_stime
is set to the current time.
.El
.Sh RETURN VALUES
@@ -127,9 +127,12 @@ will fail if:
.Fa msqid
is not a valid message queue identifier.
.Pp
+.Fa mtype
+is less than 1.
+.Pp
.Fa msgsz
is greater than
-.Va msg_qbytes .
+.Fa msg_qbytes .
.It Bq Er EACCES
The calling process does not have write access to the message queue.
.It Bq Er EAGAIN
@@ -153,6 +156,13 @@ message.
.Xr msgctl 2 ,
.Xr msgget 2 ,
.Xr msgrcv 2
+.Sh STANDARDS
+The
+.Fn msgsnd
+function conforms to the X/Open System Interfaces option of
+.St -p1003.1-2008 .
.Sh HISTORY
-Message queues appeared in
-.At V.1 .
+Message queues first appeared in
+.At V.1
+and have been available since
+.Nx 1.0 .