Fwd: CMSG_LEN, CMSG_SPACE not there on illumos

Jeremy Allison jra at samba.org
Tue Apr 28 09:42:29 MDT 2015


On Tue, Apr 28, 2015 at 10:41:15AM -0400, Gordon Ross wrote:
> Hi all,
> 
> I tried building master on illumos a few days ago and I noticed that
> this commit introduces some new places using CMSG_LEN, CMSG_SPACE etc.
> which are not provided on illumos (and probably not on Solaris, but
> I'm not sure about that).
> 
>   commit 190554c402f23a9eff1f20670e66f7b94a36b396
>   Author: Volker Lendecke <vl at samba.org>
>   Date:   Tue Dec 30 13:36:46 2014 +0000
>     lib: Add msghdr.[ch]
>     This is a little set of routines to deal with the ugly fd-passing macros.
> 
> I could attempt fixing this, but need some guidance.  I saw reference
> to a standard defining CMSG_LEN, CMSG_SPACE etc. but I only found
> Linux or BSD man pages etc.  Is these part of any official standard?
> If so, can someone provide the URL?

http://man7.org/linux/man-pages/man3/cmsg.3.html

CONFORMING TO         top

       This ancillary data model conforms to the POSIX.1g draft, 4.4BSD-
       Lite, the IPv6 advanced API described in RFC 2292 and SUSv2.
       CMSG_ALIGN() is a Linux extension.

So it is in a POSIX draft, except for CMSG_ALIGN.

> In some previous email on this list, Jeremy posted some Solaris
> patches that introduced an #ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL to
> deal with this in source3/lib/unix_msg.c.
> 
> If I go the "add another #ifdef" route, what's the appropriate thing to do here?
> I looked the the unix_msg.c changes and it seems that the
> #ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL just omits all the code related
> to FD passing.  Does that work?   Is that not needed?
> If it helps, illumos _does_ support FD passing via control messages,
> just not these CMSG_LEN, CMSG_SPACE macros etc.
> 
> Any help and advice appreciated.
> 
> Thanks,
> Gordon


More information about the samba-technical mailing list