Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2000 00:01:21 +0200
From:      Marc van Kempen <marc@bowtie.nl>
To:        Jeroen Ruigrok van der Werven <jruigrok@via-net-works.nl>
Cc:        doc@freebsd.org, Sheldon Hearn <sheldonh@uunet.co.za>
Subject:   Re: ALIGN() macro 
Message-ID:  <200005102201.AAA05448@bowtie.nl>
In-Reply-To: jruigrok's message of Wed, 10 May 2000 19:42:22 %2B0200. <20000510194221.B20181@lucifer.bart.nl> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20000510194221.B20181@lucifer.bart.nl>, Jeroen Ruigrok van der Werven writes:
>-On [20000509 12:40], Marc van Kempen (marc@bowtie.nl) wrote:
>>> 
>>> 
>>> Um, what happens when you include <sys/types.h> and <sys/socket.h> as
>>> directed by the documentation?
>>> 
>>Not much, those two files were included already and apparently don't
>>pickup <machine/param.h>
>
>Try substituting sys/param.h for sys/types.h
>
To iterate once more, 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 again 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?

See the example program, it doesn't compile without the 
<machine/param.h> include.

#include <sys/types.h>
#include <sys/socket.h>
#include <machine/param.h>

int
main(int argc, char **argv)
{
        struct msghdr msg;
        unsigned char *data;

        data = CMSG_DATA(&msg);

        return(0);
}


Marc.




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




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