Subject: Re: Understanding foo_open, foo_read, etc.
To: Peter Seebach <firstname.lastname@example.org>
From: Quentin Garnier <email@example.com>
Date: 08/29/2006 23:01:14
Content-Type: text/plain; charset=us-ascii
On Tue, Aug 29, 2006 at 03:47:19PM -0500, Peter Seebach wrote:
> With all that in mind... It'd be awfully convenient if I could easily
> clone the device, rather than cloning file descriptors, because it would
> dramatically reduce the amount of code I have to modify, since all the
> existing code is written as foo_read(device, ...) rather than foo_read(st=
> file *, ...). However, I'm not sure whether this is possible; I don't see
> anything corresponding to FreeBSD's make_dev(devsw, minor, ...).
> So, do I just have to convert to fileops instead of cdevsw ops, or is the=
> some easy way to clone the device? It looks like it's the same logic eit=
> way, one's just fewer code changes.
AFAIK, but I know or remember very little about that, but FreeBSD allows
having close() called for each call of the system call, instead of only
the last one. I prefer the NetBSD approach which is I think clearer in
What's so complicated about calling fdalloc and returning the ressult
Quentin Garnier - firstname.lastname@example.org - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)
-----END PGP SIGNATURE-----