flock and fcntl(F_SETLK)
Steven N. Hirsch
shirsch at adelphia.net
Mon Jul 20 02:03:31 CEST 1998
On Mon, 20 Jul 1998, Alan Cox wrote:
> > fcntl(F_SETLK) uses the f_op->lock(), so why doesn't flock() have a
> > similar hook in the file system?
> >
> > This inconsistency makes flock() broken when using network file
> > systems that have proper locking (like AFS). How is this supposed to
> > be implemented in network file systems?
>
> The semantics of flock not locking on network file systems go back to
> SunOS and make some sense. flock() gives you a locking scheme that is
> local and fast, lockf/fcntl locks give you slow but networked NFS locks.
Really? That's news to me. We use flock() over NFS routinely at work.
This is between AIX 4.x machines and from AIX <--> Digital Unix 4.0. Oh,
and it also works over AFS (file lock only - byte-range locking is
promised for DFS).
Steve
More information about the Arla-drinkers
mailing list