Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 1997 14:46:52 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        hasty@rah.star-gate.com (Amancio Hasty)
Cc:        terry@lambert.org, msmith@atrad.adelaide.edu.au, luigi@labinfo.iet.unipi.it, hackers@FreeBSD.ORG
Subject:   Re: device close behaviour - a question
Message-ID:  <199708012146.OAA09757@phaeton.artisoft.com>
In-Reply-To: <199708011923.MAA05657@rah.star-gate.com> from "Amancio Hasty" at Aug 1, 97 12:23:48 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Curious, shouldn't the responsibility of managing the behavior of
> open/close fall on the device driver . After all the driver should
> dictate whether it can manage multiple open instances. As for determining
> whether there are multiple opens on a device we can create an ioctl
> which returns the number of opens . Ideally, it should return instances
> of the states for each open. 

The problem is that there is not an addref entry point for drivers.

Specifically, when a process fork()'s, the new fd's are fd
references to the same vnode, and an open is not called, and
an "addref" that would add a reference instance is not called.

One can not treat this reference creation as if it were an open,
and call the open entry point.  For one thing, there might be
an implied exclusive use.  For another, the open may not result
in an identical descriptor... consider an open that completed
because some condition (which is no longer true) was met.

There needs to be a seperation of open instances from reference
instances, and that's ll there is to it.


					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?199708012146.OAA09757>