On Sun, May 03, 2009 at 01:33:42PM -0400, Taylor R Campbell
<[email protected]> wrote:
> The code in src/fdpass.C to construct control data buffers for socket
> message ancillary data fails to allocate and align sufficient space
> according to the way the API is to be used, causing the passage of
> file descriptors to fail on platforms, such as the PowerPC, that have
> more stringent alignment requirements than the x86. Attached is a
> patch to allocate and align sufficient space.
Thanks a lot!
Hmm... this gets too complicated for my tastes. Do you think that getting rid
of CMSG_SPACE and CMSG_LEN completely and just using a struct with the cmsg
header and an int would be ultimately more portable?
Since both are just ipv6 extensions, I guess systems supporting fd passig
must support using "old style" structs. And that would simplify fdpass.C even
more.
If you are willing to test, I could come up with such a change for fdpass.C.
Otherwie, I'll just use your patch, which ahs the advantage of being verified
to work :)
> so that guaranteeing alignment is simpler (malloc already does it; a
> stack-allocated buffer would require a union with a struct cmsghdr
> member to guarantee alignment),
Or simply a struct with the cmsghsr followed by an int as members, which
should give us correct alignment as well.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / [email protected]
-=====/_/_//_/\_,_/ /_/\_\
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode