Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Dec 2003 15:15:55 +0100
From:      des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=)
To:        Tim Robbins <tjr@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: new fd allocation code
Message-ID:  <xzpr7zkvfc4.fsf@dwp.des.no>
In-Reply-To: <20031204115240.GA43299@wombat.robbins.dropbear.id.au> (Tim Robbins's message of "Thu, 4 Dec 2003 22:52:40 %2B1100")
References:  <xzpn0a9akb8.fsf@dwp.des.no> <20031203232403.GA36322@wombat.robbins.dropbear.id.au> <xzp4qwg7t00.fsf@dwp.des.no> <20031204115240.GA43299@wombat.robbins.dropbear.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
[cc: to current@ instead of re@ since this will not go into 5.2]

Tim Robbins <tjr@freebsd.org> 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 <stdio.h>
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



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