flock and fcntl(F_SETLK)

Magnus Ahltorp map at stacken.kth.se
Mon Jul 20 18:09:03 CEST 1998


> 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.

Indeed, this was the case in SunOS, but this is an excerpt from the
Solaris 2.5.1 man page for flock(2):

     Locks obtained through the flock() mechanism under SunOS 4.1
     were known only within the system on which they were placed.
     This is no longer true.

In the OpenBSD 2.3 man page for flock(2), network file locking is not
mentioned. This means that a network file system is not a special case
lock-wise.

Why not give the file system an opportunity to handle this?

/Magnus
map at stacken.kth.se





More information about the Arla-drinkers mailing list