Subject: Re: CMSG_ALIGN
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: None <itojun@iijlab.net>
List: tech-net
Date: 06/28/2003 08:05:19
>Why does CMSG_ALIGN (sys/socket.h) exist?  Why not, instead, have the
>kernel increase the cmsg_len values to whatever boundary it thinks
>appropriate?  If nothing else, it would render the control-data byte
>blob entirely self-contained; as it stands, a control-data byte blob
>cannot, in general, be correctly interpreted without knowing the
>appropriate alignment multiple for the machine it was generated on.
>(It would also eliminate the need for __cmsg_alignbytes, which is
>rather an aesthetic blemish.)

	this is to address concern on 32bit/64bit dual archs.
	for instance, kernel is running in 64bits, alignment would be 8 bytes.
	if we hardcode CMSG_ALIGN to be 4 (for 32bit mode) userland and kernel
	will fail to communicate.

itojun