Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2000 12:23:30 -0700
From:      bmah@acm.org (Bruce A. Mah)
To:        marc@bowtie.nl
Cc:        hackers@FreeBSD.ORG
Subject:   Re: CMSG_DATA and ALIGN macro 
Message-ID:  <200005111923.e4BJNZ687896@nimitz.ca.sandia.gov>
In-Reply-To: <200005110630.IAA10990@bowtie.nl> 
References:  <200005110630.IAA10990@bowtie.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
If memory serves me right, Marc van Kempen wrote:

> The problem is that the ALIGN macro is not being 
> picked up even though <sys/types.h> and <sys/socket.h> are included.
> The problem arises from the use of the CMSG_DATA macro, which seems to
> be related to sendmsg(), and uses the ALIGN macro.
> 
> The manual page for sendmsg() or similar states that you only need
> <sys/types.h> and <sys/socket.h>, but this fails, it only works if 
> you also include <machine/param.h> where the ALIGN macro is defined.
> 
> So the question is: is the manual page in error or are the 
> include files wrong? If it's the manual page, in which manual
> page are you supposed to find information about the use of the 
> CMSG_DATA macro? Otherwise I suppose the <sys/socket.h> include file
> should include <sys/param.h>?

Hi Marc--

I ran into this a little while ago...you can look into the archives of 
the -current list for more details.

The upshot (as I understand it) is that CMSG_DATA shouldn't rely on the
programmer explicitly doing an #include of param.h.  No other OS seems
to require this (at least the ones to which pchar has been ported to,
which is my main area of concern).  I don't know if this has been
"fixed" or not because there were some rather complicated namespace
issues involved...you might check the CVSWeb repository.  Of the RELEASE
versions, only 4.0-RELEASE has this problem (so far).

That having been said, to bring in the definitions from param.h, what 
you're really supposed to do is to:

#include <sys/param.h>

In other words, don't do <machine/param.h>.  This was told to me by 
Bruce Evans, who presumably knows what he's doing.  :-)

Bruce.






To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005111923.e4BJNZ687896>