ABIs and the futurrrr of UNIX(tm)
Doug Gwyn
gwyn at brl-smoke.ARPA
Sun Apr 3 03:40:27 AEST 1988
In article <186 at sdeggo.UUCP> dave at sdeggo.UUCP (David L. Smith) writes:
>At the heart of my code is a set of database routines that use flock() and
>lockf() calls to keep things in order. On SunOS lockf() has an enforced
>mode, where the kernel will make routines that attempt to read/write a
>locked section block until it is unlocked. ICON choose to implement the
>Sys V version instead which does not have an enforcement mode.
I don't know the specifics of the ICON system, but I do know about
System V file/record locking. The current release of UNIX System V
provides improved locking control via a subset of the fcntl() system
call. This appeared just after SVR2.0; it includes "read" (shared)
and "write" (exclusive) advisory (cooperative) locks on any block of
bytes or the whole file. More recently, mandatory locking has been
added; it is enabled on a per-file basis by setting the Set-GID bit
on a file that does not have the Group-Execute bit set. This causes
the same fcntl() operations to be taken as mandatory locks instead of
cooperative locks.
Check your system documentation to see if any of this has been
provided. It's well enough designed that IEEE Std 1003.1 decided
to pick up most of it for the POSIX standard.
More information about the Comp.unix.wizards
mailing list