Locking with lockf() Usage: lockf( fd, command, length ); Command is F_LOCK -- exclusive lock F_TLOCK -- nonblocking F_LOCK F_ULOCK -- unlock F_TEST -- check lock status of the file lockf() is actually a library call, that works via fcntl() system call. fcntl() supports NFS locks when available. lockf() supports locking only tail ends of a file, fnctl() provides ability to lock arbitrary regions.