On Wed, Oct 06, 1999 at 12:55:52PM -0700, steve rosenbluth wrote:
> 
> This patch allows a single user to open an rtl_fifo device more than
> once.
> The first user to open a device can continue to open it repeatedly, 
> but any other user trying to open the device will get an "-EBUSY".
> This is true until the first user closes all file descriptors to
> the given fifo, after which another user may open it, etc.
> 
> This can be useful for coordinated sets of processes which all desire to
> talk
> to one device (per Rubini's Linux Device Drivers book).
> It was originally created for C++ programming, where objects which
> represent
> different parts of a multifunction device don't share data, like file
> descriptors.


A UID-based lock is _really_ nonstandard.  There's no particular reason
why multiple programs that need to access a device would have the same UID.
Implementing or using flock() would be a better solution.

> 
> The new code stores the user id of the first user to open the device in
> the
> user_open field of rt_fifo_struct (if the user is root, with a uid of 0,
> we store -1, a nonzero uid).

-1 is a valid UID.




dave...

--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to