From owner-freebsd-arch Tue May 22 12:16:10 2001 Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 8F1BB37B422 for ; Tue, 22 May 2001 12:16:04 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.3/8.11.3) with ESMTP id f4MJFrL72213; Tue, 22 May 2001 21:15:53 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Brian Somers Cc: freebsd-arch@FreeBSD.ORG Subject: Re: RFC: unit_list routines In-Reply-To: Your message of "Tue, 22 May 2001 19:42:52 BST." <200105221842.f4MIgqb84117@hak.lan.Awfulhak.org> Date: Tue, 22 May 2001 21:15:53 +0200 Message-ID: <72211.990558953@critter> From: Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi Brian, Couldn't the resource manager used for interrupts and similar do this as well ? In message <200105221842.f4MIgqb84117@hak.lan.Awfulhak.org>, Brian Somers write s: >Hi, > >I want to change if_tun.c so that userland can open /dev/tun and get >back a /dev/tunX device. To do this, I need to track the units that >have (or haven't) been opened, and I figure other devices may wish to >do this too. > >To this end, I've written the attached URLs for > > /sys/kern/unit_list.c > /sys/sys/unit_list.h > >and have also attached URLs for patches to /sys/conf/files and >/sys/net/if_tun.c. > >The unit_list stuff is designed to be an easy way of tracking sparce >arrays of units - arrays that are generally expected to start at zero >and increment, but may sometimes be allocated randomly. > >I haven't tested as extensively as I plan to because my dev box is >useless at the moment due to mutex problems, but I believe it works :) > >I ansified if_tun.c while I was there - sorry if that complicates any >reviews :-/ > >Comments ? > > ftp://ftp.Awfulhak.org/pub/unit_list/sys-kern-unit_list.c > ftp://ftp.Awfulhak.org/pub/unit_list/sys-sys-unit_list.h > ftp://ftp.Awfulhak.org/pub/unit_list/sys-conf-files.patch > ftp://ftp.Awfulhak.org/pub/unit_list/sys-net-if_tun.c.patch > >Cheers. >-- >Brian > >Don't _EVER_ lose your sense of humour ! > > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-arch" in the body of the message > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message