int lockf(int fd, int cmd, off_t len);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
On Linux, lockf() is just an interface on top of fcntl(2) locking. Many other systems implement lockf() in this way, but note that POSIX.1 leaves the relationship between lockf() and fcntl(2) locks unspecified. A portable application should probably avoid mixing calls to these interfaces.
Valid operations are given below:
locks.txt and mandatory-locking.txt in the Linux kernel source directory Documentation/filesystems (on older kernels, these files are directly under the Documentation directory, and mandatory-locking.txt is called mandatory.txt)