Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 1997 10:40:34 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        msmith@atrad.adelaide.edu.au (Michael Smith)
Cc:        luigi@labinfo.iet.unipi.it, hackers@FreeBSD.ORG
Subject:   Re: device close behaviour - a question
Message-ID:  <199708011740.KAA09486@phaeton.artisoft.com>
In-Reply-To: <199708010531.PAA03720@genesis.atrad.adelaide.edu.au> from "Michael Smith" at Aug 1, 97 03:01:23 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > I am having a problem related to the having multiple (actually,
> > 2) open descriptors on the same character device. More specifically,
> > I notice that only the last close does actually invoke the device
> > close routine.
> 
> Heh.  This one is tricky.

Poul-Henning was talking about this before on the -current list.

In general, I believe everyone agreed that it was desirable to
differentiate between "close" and "last close" to provide for
"per open instance" private data on devices.

There is an issue on open, as well, since a device may be
instanced once, but have multiple references created for it
(Mike's inheritance of fd's on fork() or on exec() without
the close-on-exec flag set via fcntl() is one example of this).

The issue is that there is not a semantic seperation between
reference instance vs. device instance at open time, so a close
differentiation is less than useful.  Both corrections would
need to occur simultaneously for either one to be useful alone.


> You cannot ever guarantee any fixed number of openers on a device.

O_EXCL or function equivalent.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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