Re: PROPOSAL: API for device locking library.
On Fri, Oct 22, 1999 at 12:57:21PM +0100, Alan Cox wrote:
> It doesn't address threaded applications where the threads are all
> seperate pids (as in Linuxthreads). That probably needs clarifying
Is this really an issue?
relock_dev() is provided to exchange the lock ownership between related
processes (when one is going to die), and can be used also in this
case, but can be arranged internally of the threaded program.
> Secondly it ignores all the aliasing and security issues. Eg if I lock
> /dev/tty and someone else wants to lock /dev/tty then its valid to do so.
good point here. I can expand it to use the real tty name.
> I think we should take a leaf from the IETF here. Design it, write it, debug
> it _then_ standardise it. So long as FHS standardises the lockfile paths
> for /dev/tty* (/dev/cua is obsolete) then the issue is sorted.
> Its an interesting idea, but it is pure research, might not be implementable
> and has a whole raft of obvious issues to be resolved like if you lock
> by major/minor or by name etc. Until someone proves it works and its useful
> I feel strongly it should be encouraged as a project but most definitely
> not put anywhere near the LSB
Maybe you've missed that one (maybe two) implementations already exist.
Security issues are still open, but the intent to proposing it to LSB is
not to "freeze an implementation", but only one API, leaving
implementation details undefined.
The goal is to have all applications that want to lock a device load a
library with a certain name, and use the functions defined in this API.
Then each vendor is free to supply his own solution, as far as it comply
with the API, permitting even binary-only applications to use the
It's not important which locking method is used (unles it's a broken
one), if all the programs accessing the device are using the same
| firstname.lastname@example.org email@example.com firstname.lastname@example.org
| 6F7267F5 fingerprint 57 16 C4 ED C9 86 40 7B 1A 69 A1 66 EC FB D2 5E
| email@example.com gsm: +358 (0)40 707 2468