Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Dec 2001 05:41:08 -0600
From:      Alfred Perlstein <bright@mu.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Dave Rufino <dr263@hermes.cam.ac.uk>, Terry Lambert <tlambert2@mindspring.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: statefulness in character device drivers
Message-ID:  <20011208054108.C92148@elvis.mu.org>
In-Reply-To: <49036.1007811221@critter.freebsd.dk>; from phk@critter.freebsd.dk on Sat, Dec 08, 2001 at 12:33:41PM %2B0100
References:  <Pine.SOL.4.33.0112081058220.29494-100000@orange.csi.cam.ac.uk> <49036.1007811221@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
* Poul-Henning Kamp <phk@critter.freebsd.dk> [011208 05:35] wrote:
> In message <Pine.SOL.4.33.0112081058220.29494-100000@orange.csi.cam.ac.uk>, Dav
> e Rufino writes:
> >
> >
> >On Sat, 8 Dec 2001, Poul-Henning Kamp wrote:
> >
> >> >They are talking about "per-open", not "per-fd-instance" data,
> >> >which could easily exclude dup, dup2, and fcntl(f_DUPFD).
> >>
> >> If you don't include dup/dup2/fnctl in your accounting, you
> >> can only reliably tell "first open", "another open", "some close"
> >> and "final close".  You an modulate this with the pid, but you
> >> still have no idea what is going on in any amount of detail.
> >
> >Speaking for myself, first open and final close would be all I need for
> >the nvidia driver - though i'm sure tracking dup/dup2/fcntl would be
> >preferable in the general case.
> 
> first open/last close has been the UNIX way for decades...

Yes, but afaik without a way to differenciate between two
opens.  Being able to notice whether a file is being operated
on via which open is the important part.

This would probably involve changing VOP_OPENs to pass a void **
that would be stored in the struct file that would be passed
to subsequent ioctl/read/write/close operations.

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
                           http://www.morons.org/rants/gpl-harmful.php3

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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