From owner-freebsd-questions@FreeBSD.ORG Wed Dec 21 18:42:06 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54C9216A41F for ; Wed, 21 Dec 2005 18:42:06 +0000 (GMT) (envelope-from tofik@oxygen.az) Received: from mail.alkar.net (mail.alkar.net [195.248.191.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4FD343D5E for ; Wed, 21 Dec 2005 18:42:05 +0000 (GMT) (envelope-from tofik@oxygen.az) Received: from [213.227.193.75] (HELO [192.168.0.177]) by mail.alkar.net (CommuniGate Pro SMTP 4.3.9) with ESMTP id 415636050 for questions@freebsd.org; Wed, 21 Dec 2005 20:42:04 +0200 Message-ID: <43A9BE31.5080102@oxygen.az> Date: Wed, 21 Dec 2005 20:42:25 +0000 From: Tofik Suleymanov User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: sendmsg question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 18:42:06 -0000 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?)