.\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
+.\"
+.\" %%%LICENSE_START(VERBATIM_ONE_PARA)
.\" Permission is granted to distribute possibly modified copies
.\" of this page provided the header is included verbatim,
.\" and in case of nontrivial modification author and date
.\" of the modification is added to the header.
+.\" %%%LICENSE_END
+.\"
.\" $Id: cmsg.3,v 1.8 2000/12/20 18:10:31 ak Exp $
.TH CMSG 3 2008-11-20 "Linux" "Linux Programmer's Manual"
.SH NAME
-CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- Access ancillary data
+CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- access ancillary data
.SH SYNOPSIS
.B #include <sys/socket.h>
.sp
ancillary data) that are not a part of the socket payload.
This control information may
include the interface the packet was received on, various rarely used header
-fields, an extended error description, a set of file descriptors or Unix
+fields, an extended error description, a set of file descriptors or UNIX
credentials.
For instance, control messages can be used to send
additional header fields such as IP options.
Ancillary data is a sequence of
.I struct cmsghdr
structures with appended data.
-This sequence should only be accessed
-using the macros described in this manual page and never directly.
+This sequence should be accessed
+using only the macros described in this manual page and never directly.
See the specific protocol man pages for the available control message types.
The maximum ancillary buffer size allowed per socket can be set using
.IR /proc/sys/net/core/optmem_max ;
on the
.I msghdr
to get the first control message and
-.BR CMSG_NEXTHDR ()
+.BR CMSG_NXTHDR ()
to get all subsequent ones.
In each control message, initialize
.I cmsg_len
.I msg_flags
member of the
.IR msghdr .
-.SH "CONFORMING TO"
+.SH CONFORMING TO
This ancillary data model conforms to the POSIX.1g draft, 4.4BSD-Lite,
the IPv6 advanced API described in RFC\ 2292 and the SUSv2.
.BR CMSG_ALIGN ()
is a Linux extension.
.SH NOTES
-For portability, ancillary data should be accessed only using the macros
+For portability, ancillary data should be accessed using only the macros
described here.
.BR CMSG_ALIGN ()
-is a Linux extension and should be not used in portable programs.
+is a Linux extension and should not be used in portable programs.
.PP
In Linux,
.BR CMSG_LEN (),
are constant expressions (assuming their argument is constant);
this could be used to declare the size of global
variables.
-This may be not portable, however.
+This may not be portable, however.
.SH EXAMPLE
This code looks for the
.B IP_TTL
.fi
.in
.PP
-The code below passes an array of file descriptors over a Unix socket using
+The code below passes an array of file descriptors over a
+UNIX domain socket using
.BR SCM_RIGHTS :
.PP
.in +4n
msg.msg_controllen = cmsg\->cmsg_len;
.fi
.in
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR recvmsg (2),
.BR sendmsg (2)
.PP
RFC\ 2292
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.