summaryrefslogtreecommitdiff
path: root/share/man
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
commit0bdf18c9edb2e6a9fa89a28e89d11e7b6785b1fd (patch)
treebd0dc86a525e38150bde9f0c3d55ad9dfeb4e6a2 /share/man
parent6e48c70f167662c7aec42af9bafc316e322ef92a (diff)
msg_controllen has to be CMSG_SPACE so that the kernel can account for
each cmsg_len (ie. msg_controllen = sum of CMSG_ALIGN(cmsg_len). This works now that kernel fd passing has been fixed to accept a bit of sloppiness because of this ABI repair. lots of discussion with kettenis
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man3/CMSG_DATA.313
1 files changed, 6 insertions, 7 deletions
diff --git a/share/man/man3/CMSG_DATA.3 b/share/man/man3/CMSG_DATA.3
index 28e5b498ad2..1beb705b425 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.4 2008/03/15 16:27:48 deraadt Exp $
+.\" $OpenBSD: CMSG_DATA.3,v 1.5 2008/03/24 16:11:07 deraadt Exp $
.\" Written by Jared Yanovich <jaredy@openbsd.org>
.\" Public domain, July 3, 2005
-.Dd $Mdocdate: March 15 2008 $
+.Dd $Mdocdate: March 24 2008 $
.Dt CMSG_DATA 3
.Os
.Sh NAME
@@ -61,10 +61,9 @@ This routine determines the size in bytes of a control message,
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
+This value is what is normally stored in the
.Fa cmsg_len
-and
-.Fa msg_msgcontrollen .
+of each control message.
This routine accounts for any alignment constraints on the beginning of
ancillary data.
.It Fn CMSG_NXTHDR mhdr cmsg
@@ -99,7 +98,7 @@ union {
memset(&msg, 0, sizeof(msg));
msg.msg_control = &cmsgbuf.buf;
-msg.msg_controllen = CMSG_LEN(sizeof(int));
+msg.msg_controllen = sizeof(cmsgbuf.buf);
cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@@ -122,7 +121,7 @@ union {
memset(&msg, 0, sizeof(msg));
msg.msg_control = &cmsgbuf.buf;
-msg.msg_controllen = CMSG_LEN(sizeof(int));
+msg.msg_controllen = sizeof(cmsgbuf.buf);
if (recvmsg(s, &msg, 0) == -1)
err(1, "recvmsg");