Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Oct 2005 21:43:30 -0400
From:      John <jwd@bsdwins.com>
To:        freebsd-amd64@freebsd.org
Subject:   CMSG_DATA() 32/64 bit binary incompatibility
Message-ID:  <20051011014330.GA58707@bsdwins.com>

next in thread | raw e-mail | index | archive | help
Hi folks,

   I'd like some opinions.

   The CMSG_DATA() definition in sys/socket.h returns different
values when compiled for 32 bit (address + offset 12), or 64 bit
(address + offset 16).

   A 32 bit application copied over to a 64 bit system which uses
ipc SCM_RIGHTS does not work. An application compiled on a 64 bit
systems with -m32 -B/usr/lib32 options to produce a 32 bit binary
does not work either. Compiled as a 64 bit application it works
of course.

   The documentation element of struct cmsghdr (cmsg_data) is
documented as being type u_char. However, the alignment provided
by the _ALIGN() macro is based on 'long', which varies depending
on the compilation target (32 or 64 bit).

   Within the kernel, there is currently no distinction between
a 32 bit app with 32 bit alignment, or a 64 bit app with 64 bit
alignment (uipc_usrreg.c:unp_internalize()).

   And thus the opinion request. Should the macro definition
be fixed? Should the kernel be able to distinquish between a 32
bit or 64 bit application? 

Thoughts?
John



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