How can I test whether fcntl() locks work with my NFS setup?

From the SQLite FAQ:

  1. Can multiple applications or multiple instances of the same application access a single database file at the same time?

    SQLite uses reader/writer locks to control access to the database. … But use caution: this locking mechanism might not work correctly if the database file is kept on an NFS filesystem. This is because fcntl() file locking is broken on many NFS implementations. You should avoid putting SQLite database files on NFS if multiple processes might try to access the file at the same time. …

Is there a simple test to see whether fcntl() locking works for my combination of NFS client and server?


I contacted Vincent at bullopensource, which no longer exists. He has moved the code here: https://sourceforge.net/projects/locktests/
Worked for me. Enjoy.