From owner-freebsd-amd64@FreeBSD.ORG Tue Oct 11 02:18:42 2005 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B8FB16A41F for ; Tue, 11 Oct 2005 02:18:42 +0000 (GMT) (envelope-from jwd@bsdwins.com) Received: from bsdone.bsdwins.com (www.bsdwins.com [192.58.184.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id B547D43D46 for ; Tue, 11 Oct 2005 02:18:41 +0000 (GMT) (envelope-from jwd@bsdwins.com) Received: from bsdone.bsdwins.com (localhost [127.0.0.1]) by bsdone.bsdwins.com (8.13.1/8.13.1) with ESMTP id j9B1hUbc069512 for ; Mon, 10 Oct 2005 21:43:30 -0400 (EDT) (envelope-from jwd@www.bsdwins.com) Received: (from jwd@localhost) by bsdone.bsdwins.com (8.13.1/8.13.1/Submit) id j9B1hU0Z069511 for freebsd-amd64@freebsd.org; Mon, 10 Oct 2005 21:43:30 -0400 (EDT) (envelope-from jwd) Date: Mon, 10 Oct 2005 21:43:30 -0400 From: John To: freebsd-amd64@freebsd.org Message-ID: <20051011014330.GA58707@bsdwins.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Scanned-By: MIMEDefang 2.51 on 127.0.0.1 Subject: CMSG_DATA() 32/64 bit binary incompatibility X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2005 02:18:42 -0000 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