Contains message information.
#include <sys/socket.h>
struct msghdr
{
caddr_t *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
int msg_iovlen;
caddr_t *msg_accrights;
socklen_t msg_accrightslen;
#define msg_control msg_accrights
#define msg_controllen msg_accrightslen
int msg_flags;
};
Points to an optional address.
Specifies the size of msg_name.
Points to the scatter/gather array.
Specifies the number of elements in msg_iov.
The double define for this field allows this structure to be used in a BSD 4.3 or Linux environment. As msg_accrights, is unused (set to 0). As msg_control, points to a buffer containing ancillary data.
The double define for this field allows this structure to be used in a BSD 4.3 or Linux environment. As msg_accrightslen, is unused (set to 0). As msg_controllen, specifies the length of the ancillary data that follows this structure. The ancillary data consists of a cmsghdr structure followed by the acutual data. See cmsghdr.
Reserved.
The msg_name and msg_addrlen fields specify the source address if the socket is unconnected. If the address isn't desired, it can be set to NULL. If the socket is connected, the msg_name and msg_addrlen fields are ignored. The msg_iov and msg_iovlen fields specify where the data is stored.