From owner-freebsd-current@FreeBSD.ORG Sun Sep 9 17:20:41 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C84A16A41B for ; Sun, 9 Sep 2007 17:20:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D814013C46C for ; Sun, 9 Sep 2007 17:20:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.13.4) with ESMTP id l89HIaT7050902; Sun, 9 Sep 2007 11:18:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 09 Sep 2007 11:18:45 -0600 (MDT) Message-Id: <20070909.111845.-861032475.imp@bsdimp.com> To: rizzo@icir.org From: "M. Warner Losh" In-Reply-To: <20070906111028.A83649@xorpc.icir.org> References: <20070906111028.A83649@xorpc.icir.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 09 Sep 2007 11:18:36 -0600 (MDT) Cc: current@freebsd.org Subject: Re: how to tell 64 vs 32 bit architecture ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Sep 2007 17:20:41 -0000 In message: <20070906111028.A83649@xorpc.icir.org> Luigi Rizzo writes: : hi, : i was wondering what is the proper way to tell a 64 vs 32 bit architecture. : : I see that some code in sys/ uses ' #ifdef __LP64__ ' but i am not : sure if this is generic enough (ie not gcc or FreeBSD specific), : and also suitable for userland (i.e. works on linux or other platforms : as well). It is portable. gcc, and other compilers, define this when using longs and pointers as 64 bit. There's also ILP32 and ILP64 programming models, but only windows 64 uses the latter. Typically, however, there are better ways to solve problems relating to these differences. What kinds of problems are you trying to solve? Warner