Subject: Re: BIND 9 vs NetBSD 1.4U
To: Michael Graff <Michael.Graff@nominum.com>
From: None <itojun@iijlab.net>
List: tech-net
Date: 03/14/2000 09:00:48
>Are the CMSG_SPACE() macros no longer usable to allocate space for various
>buffer bits?

	RFC2292 says like this, this is the reasoning I thought it is
	okay to put function call in CMSG_SPACE().  not sure the "dynamic"
	means "not for static allocation", or "static allocation is allowed".

	Are there anyone have Posix.1g handy?

	(I'll try to update code around here soon...)

itojun


4.3.4.  CMSG_SPACE

       unsigned int CMSG_SPACE(unsigned int length);

   This macro is new with this API.  Given the length of an ancillary
   data object, CMSG_SPACE() returns the space required by the object
   and its cmsghdr structure, including any padding needed to satisfy
   alignment requirements.  This macro can be used, for example, to
   allocate space dynamically for the ancillary data.  This macro should
   ~~~~~~~~~~~~~~~~~~~~~~~~~~
   not be used to initialize the cmsg_len member of a cmsghdr structure;
   instead use the CMSG_LEN() macro.

   One possible implementation could be:

       #define CMSG_SPACE(length) ( ALIGN(sizeof(struct cmsghdr)) + \
                                    ALIGN(length) )