From owner-freebsd-current@FreeBSD.ORG Thu Dec 4 06:16:07 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 115D516A4CE; Thu, 4 Dec 2003 06:16:07 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84BD743F3F; Thu, 4 Dec 2003 06:16:04 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 3155D530C; Thu, 4 Dec 2003 15:16:03 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 142D05308; Thu, 4 Dec 2003 15:15:56 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id EEF6133C6A; Thu, 4 Dec 2003 15:15:55 +0100 (CET) To: Tim Robbins References: <20031203232403.GA36322@wombat.robbins.dropbear.id.au> <20031204115240.GA43299@wombat.robbins.dropbear.id.au> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Thu, 04 Dec 2003 15:15:55 +0100 In-Reply-To: <20031204115240.GA43299@wombat.robbins.dropbear.id.au> (Tim Robbins's message of "Thu, 4 Dec 2003 22:52:40 +1100") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.1 required=5.0 tests=RCVD_IN_SORBS autolearn=no version=2.60 cc: current@freebsd.org Subject: Re: new fd allocation code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Thu, 04 Dec 2003 14:16:07 -0000 [cc: to current@ instead of re@ since this will not go into 5.2] Tim Robbins writes: > Why would it be incorrect? I changed NDENTRIES to sizeof(u_int) * NBBY > as well. If you made sure that NDENTRIES and NDENTRYSHIFT are derived from sizeof(u_int), then the only problem is the misspelling of unsigned int as u_int. You should take note, though, that using unsigned int instead of uint32_t most does not do what I think you think it does; unsigned int is 32 bits wide on all platforms FreeBSD supports. If you want 64 bits on 64-bit platforms, use unsigned long. des@ultra ~% uname -a FreeBSD ultra.des.no 5.2-BETA FreeBSD 5.2-BETA #4: Mon Nov 24 15:47:18 CET = 2003 des@ultra.des.no:/usr/src/sys/sparc64/compile/ultra sparc64 des@ultra ~% cat int.c #include int main(void) { printf("%lu %lu\n", (unsigned long)sizeof(int) * 8, (unsig= ned long)sizeof(long) * 8); return 0; } des@ultra ~% cc -Wall -pedantic -O -pipe -o int int.c des@ultra ~% ./int 32 64 > What do your assertions look like? I assert that the fd passed to fd_used() is not already marked as used, and similarly that the fd passed fd_unused() is not already marked as unused. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no