sendmsg question

Tofik Suleymanov tofik at oxygen.az
Wed Dec 21 10:42:06 PST 2005


I get this from 'man 2 recv' :
ssize_t recvmsg(int s, struct msghdr *msg, int flags);

Where 'struct msghdr' is described in sys/socket.h like:

struct msghdr {
             caddr_t msg_name;       /* optional address */
             u_int   msg_namelen;    /* size of address */
             struct  iovec *msg_iov; /* scatter/gather array */
             u_int   msg_iovlen;     /* # elements in msg_iov */
             caddr_t msg_control;    /* ancillary data, see below */
             u_int   msg_controllen; /* ancillary data buffer len */
             int     msg_flags;      /* flags on received message */
     };

And where 'caddr_t  msg_control' is also described in sys/socket.h like:
    struct cmsghdr {
             u_int   cmsg_len;       /* data byte count, including hdr */
             int     cmsg_level;     /* originating protocol */
             int     cmsg_type;      /* protocol-specific type */
     /* followed by
             u_char  cmsg_data[]; */
     };

I'm obviously missing something, but how can i get the actual data 
coming from socket
using this function if  'u_char cmsg_data[]' is commented out in 'struct 
cmsghdr' declaration (possibly containing incoming data?)





More information about the freebsd-questions mailing list