Xref: utzoo comp.unix.questions:10343 comp.unix.wizards:12877 Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: what is the 'l' permission? Message-ID: <516@auspex.UUCP> Date: 26 Nov 88 06:27:30 GMT References: <71@attibr.UUCP> <4594@ptsfa.PacBell.COM> <483@auspex.UUCP> <4945@b-tech.ann-arbor.mi.us> <951@vsi.COM> <1988Nov25.213310.11511@utzoo.uucp> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 15 >Consider a program that mandatory-locks /etc/passwd and then sleeps forever. >Antisocial, no? So mandatory locking is available only on files that are >explicitly marked as "okay to lock". Well, actually, in order to lock out reads, you have to establish a write lock on the region in question, and to establish a write lock you need to have a file descriptor open for writing; if you have a file descriptor for "/etc/passwd" that's open for writing, you can do much more antisocial things than just locking it forever.... In AT&T's documentation, they appear to recommend that you not use mandatory locking because there's extra overhead on every read or write performed, since before every read or write the system has to check for locks. They also note that mandatory locking is not always necessary nor sufficient.