From owner-freebsd-current Mon Jun 10 14:16:53 2002 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 56D2737B408 for ; Mon, 10 Jun 2002 14:16:47 -0700 (PDT) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.3/8.12.2) with ESMTP id g5ALFJV7029347; Mon, 10 Jun 2002 23:15:20 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Maksim Yevmenkin Cc: current@FreeBSD.ORG Subject: Re: Device cloning In-Reply-To: Your message of "Mon, 10 Jun 2002 14:13:47 PDT." <20020610211347.71117.qmail@web13305.mail.yahoo.com> Date: Mon, 10 Jun 2002 23:15:19 +0200 Message-ID: <29346.1023743719@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20020610211347.71117.qmail@web13305.mail.yahoo.com>, Maksim Yevmenk in writes: >Hackers, > >The project i'm working on might require some sort of >device cloning. The current way of cloning, i.e. use >DEVFS and allocate unique minor numbers, is not very >good for my purpose. > >The idea is simple: the same device(major,minor) can >be opened several times by different processes (or >possibly threads within the same process) and each >process (thread) will have unique device instance. Sorry, but this wont work for a large number of reasons. For one thing none of the dup(2) or fork(2) like systemcalls report what happens to the filedescriptors down to the device drivers so you have no way to correctly track which process or which instance you are working on. -- 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-current" in the body of the message