what is the 'l' permission?
Stephen J. Friedl
friedl at vsi.COM
Fri Nov 25 06:17:34 AEST 1988
In article <4945 at b-tech.ann-arbor.mi.us>, zeeff at b-tech.ann-arbor.mi.us (Jon Zeeff) writes:
> Can someone explain "mandatory locking" as used here. I find that Sys V.3
> allows two processes to open and write to a file with 'l' permisssions.
There are two kinds of locks supported by most versions of UNIX
(Sys V, at least), advisory and mandatory.
An advisory lock is a Post-it(tm) put on a record saying "please
keep away", and a program is free to ignore it. It requires that
two programs dealing with a file cooperate by always querying the
locks first, and an uncooperative or buggy program can read or
write any record.
Mandatory (aka `enforcement-mode') locks, on the other hand, live
inside the read/write mechanism. If a file has the mandatory
lock bit set in the mode, locking a record will prevent any access
to that record by any program even if this other program has no
knowledge of locks.
I'm speculating on this part, but I guess that setting the `l' mode
is required because the vast majority of programs don't use locking,
and the overhead required on each read/write call is probably too much.
Setting the lock bit probably enables this checking.
--
Steve Friedl V-Systems, Inc. +1 714 545 6442 3B2-kind-of-guy
friedl at vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl
------------Nancy Reagan on climaxes: "Just say moan!"-------------
:wq!
More information about the Comp.unix.wizards
mailing list