Operating systems, development tools, and professional services
for connected embedded systems Developer Resources   PDF
Documents More resources   Lock or unlock a section of a file
#include <unistd.h>  int lockf( int filedes,            int
function,            off_t size );   The file descriptor for the
file that you want to lock. Open the file with write-only
permission (O_WRONLY) or with read/write permission (O_RDWR). A
control value that specifies the action to be taken. The
permissible values (defined in <unistd.h>) are as follows: Lock
a section for exclusive use if the section is available. A read-
only lock is one of O_RDONLY, O_WRONLY, or O_RDWR. An exclusive
lock is one of O_WRONLY, or O_RDWR. (For descriptions of the
locks, see open()). Test a specified section for locks obtained
by other processes. Test and lock a section for exclusive use if
the section is available. Remove locks from a specified section
of the file. The number of contiguous bytes that you want to
lock or unlock. The section