Mandatory locking (was Re: the 'l' permission)

Chip Salzenberg chip at ateng.ateng.com
Sun Nov 27 13:00:52 AEST 1988


[Followups directed to comp.unix.xenix; you'll see why.]

According to guy at auspex.UUCP (Guy Harris):
>"Mandatory locking" merely means that if you use
>"fcntl" or "lockf" to lock a region of the file, attempts to write the
>locked region of the file will block until the lock is released, and
>if the lock is also supposed to block attempts to read that region, it
>will do that as well.

...and unfortunately, despite all protestations to the contrary, SCO Xenix
does *not* comply with the SVID on this topic.  Even though it's called
"Xenix System V."

Under SCO Xenix, there are three locking methods:

	locking(), a Xenix invention
	lockf(), per /usr/group and in the SVID
	fcntl(), in the SVID

None, that's right, *none* of these locking methods provides advisory
locking under SCO Xenix.  Even though fcntl() and lockf() MUST be
advisory to conform to the SVID.  Instead, we get mandatory locking and,
therefore, deadlocks on programs written to the SVID.  (I wonder what
the merged product does?)

A side effect of this is that all files to be locked -- for reading or
writing, it doesn't matter -- must be opened with write permissions.

Sigh.

I tested it on SCO Xenix/286 2.2.1.  It's true.  I wish it weren't.
-- 
Chip Salzenberg             <chip at ateng.com> or <uunet!ateng!chip>
A T Engineering             Me?  Speak for my company?  Surely you jest!
	   Beware of programmers carrying screwdrivers.



More information about the Comp.unix.wizards mailing list