summaryrefslogtreecommitdiff
path: root/share/man/man3/CMSG_DATA.3
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-15 16:27:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-15 16:27:49 +0000
commit2353f15379f45d90e504645a87cf159e49bb777f (patch)
tree9b165e3bef79fb29024a520a35f4049f17c5505e /share/man/man3/CMSG_DATA.3
parent9be25461b8f9ab996d7fff99c7f04b3d8dcccaa4 (diff)
show the correct idiom
Diffstat (limited to 'share/man/man3/CMSG_DATA.3')
-rw-r--r--share/man/man3/CMSG_DATA.312
1 files changed, 7 insertions, 5 deletions
diff --git a/share/man/man3/CMSG_DATA.3 b/share/man/man3/CMSG_DATA.3
index 7285c8e62e7..28e5b498ad2 100644
--- a/share/man/man3/CMSG_DATA.3
+++ b/share/man/man3/CMSG_DATA.3
@@ -1,7 +1,7 @@
-.\" $OpenBSD: CMSG_DATA.3,v 1.3 2008/03/13 01:49:53 deraadt Exp $
+.\" $OpenBSD: CMSG_DATA.3,v 1.4 2008/03/15 16:27:48 deraadt Exp $
.\" Written by Jared Yanovich <jaredy@openbsd.org>
.\" Public domain, July 3, 2005
-.Dd $Mdocdate: March 13 2008 $
+.Dd $Mdocdate: March 15 2008 $
.Dt CMSG_DATA 3
.Os
.Sh NAME
@@ -62,7 +62,9 @@ which includes the control message header.
.Fa len
specifies the length of the data held by the control message.
This value is what is normally stored in
-.Fa cmsg_len .
+.Fa cmsg_len
+and
+.Fa msg_msgcontrollen .
This routine accounts for any alignment constraints on the beginning of
ancillary data.
.It Fn CMSG_NXTHDR mhdr cmsg
@@ -97,7 +99,7 @@ union {
memset(&msg, 0, sizeof(msg));
msg.msg_control = &cmsgbuf.buf;
-msg.msg_controllen = sizeof(cmsgbuf.buf);
+msg.msg_controllen = CMSG_LEN(sizeof(int));
cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@@ -120,7 +122,7 @@ union {
memset(&msg, 0, sizeof(msg));
msg.msg_control = &cmsgbuf.buf;
-msg.msg_controllen = sizeof(cmsgbuf.buf);
+msg.msg_controllen = CMSG_LEN(sizeof(int));
if (recvmsg(s, &msg, 0) == -1)
err(1, "recvmsg");