Some articles on fcntl:

File Locking - In Unix-like Systems - Problems
... Both flock and fcntl have quirks that occasionally puzzle programmers more familiar with other operating systems ... These locks will be visible to other NFS clients that implement fcntl-style POSIX locks, but invisibile to those that do not ... All fcntl locks associated with a file for a given process are removed when any file descriptor for that file is closed by that process, even if a lock was ...