Xref: utzoo comp.unix.questions:10332 comp.unix.wizards:12850 Path: utzoo!attcan!uunet!vsi!friedl From: friedl@vsi.COM (Stephen J. Friedl) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: what is the 'l' permission? Summary: Mandatory -vs- advisory locks Message-ID: <951@vsi.COM> Date: 24 Nov 88 20:17:34 GMT References: <71@attibr.UUCP> <4594@ptsfa.PacBell.COM> <483@auspex.UUCP> <4945@b-tech.ann-arbor.mi.us> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 30 In article <4945@b-tech.ann-arbor.mi.us>, zeeff@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@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl ------------Nancy Reagan on climaxes: "Just say moan!"------------- :wq!