Date: Wed, 21 Dec 2005 20:42:25 +0000 From: Tofik Suleymanov <tofik@oxygen.az> To: questions@freebsd.org Subject: sendmsg question Message-ID: <43A9BE31.5080102@oxygen.az>
next in thread | raw e-mail | index | archive | help
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?)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43A9BE31.5080102>