From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 15 16:14:50 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7CA916A408 for ; Thu, 15 Feb 2007 16:14:50 +0000 (UTC) (envelope-from caelian@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.224]) by mx1.freebsd.org (Postfix) with ESMTP id 932A213C4B3 for ; Thu, 15 Feb 2007 16:14:50 +0000 (UTC) (envelope-from caelian@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so740804wxc for ; Thu, 15 Feb 2007 08:14:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=tSSQBOayzmd7qcV4u5HKlCKxmVAHSrHHRbFBKOqj0p8GewsM54sq14eL+YM0acmNyG3mhRgLsxu9D63gavarVqEcAb22Xu0WdXdHum/00aadSBKwWy8LGPFSGU6yOJsiCVVG1PbB5gt79a7C6Fn5g97w1Mo62RiQjZyVtpkFW1Y= Received: by 10.90.55.19 with SMTP id d19mr2580859aga.1171556090043; Thu, 15 Feb 2007 08:14:50 -0800 (PST) Received: from ?192.168.0.21? ( [87.166.95.91]) by mx.google.com with ESMTP id 24sm2745834ugf.2007.02.15.08.14.49; Thu, 15 Feb 2007 08:14:49 -0800 (PST) From: Pascal Hofstee To: Robert Watson In-Reply-To: <20070215133647.V79543@fledge.watson.org> References: <45C04593.2090704@gmail.com> <20070131085206.GW892@turion.vk2pj.dyndns.org> <45C06167.60401@gmail.com> <86odofjyua.fsf@dwp.des.no> <20070131105024.L91177@fledge.watson.org> <20070215133647.V79543@fledge.watson.org> Content-Type: text/plain Date: Thu, 15 Feb 2007 17:14:47 +0100 Message-Id: <1171556087.9285.1.camel@chekov> Mime-Version: 1.0 X-Mailer: Evolution 2.9.91 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= , hackers@freebsd.org Subject: Re: a question regarding X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2007 16:14:51 -0000 On Thu, 2007-02-15 at 13:41 +0000, Robert Watson wrote: > Unfortunately, things are a bit more tricky. The problem is not so much the > API, where converting size_t/int is a relative non-event, rather, the ABI. By > changing the size of a field in a data structure, you may change the layout of > the structure, and hence the offset of other fields. This offset information > is compiled into binaries that access the structure -- hence being part of the > ABI. On i386, the change from int to size_t doesn't modify the ABI, as both > int and size_t are 32-bit. However, on 64-bit platforms, int is 32-bit and > size_t is 64-bit: > > sledge:/tmp> uname -a > FreeBSD sledge.freebsd.org 7.0-CURRENT FreeBSD 7.0-CURRENT #898: Wed Feb 14 > 14:20:16 UTC 2007 root@sledge.freebsd.org:/h/src/sys/amd64/compile/SLEDGE > amd64 > sledge:/tmp> ./size_t > sizeof int: 4 > sizeof size_t: 8 > > In practice, this means that all of the later fields in the data structure > will be offset by 4 bytes. This will affect any application that accesses > later fields in the structure but isn't recompiled. This is why DES and I > have been discussing this change as requiring kernel compatibility code, which > would provide new system calls working with the new layout, and retain old > system calls working with the old layout. So we'd need to provide a new > shmctl() with the new structure, and an oshmctl() with the old layout. While > doing that, it makes sense to do all the other ABI-related things that we'd > like to get out of the way, such as fixing the types in shm_perm. I understand ... i'll leave this up to you guys .. you have obviously a lot more hands on experience in these kinds of matters :) -- Pascal Hofstee