'\" t .\" Title: posix_lock_file .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: April 2019 .\" Manual: The Linux VFS .\" Source: Kernel Hackers Manual 4.9.168 .\" Language: English .\" .TH "POSIX_LOCK_FILE" "9" "April 2019" "Kernel Hackers Manual 4\&.9\&." "The Linux VFS" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" posix_lock_file \- Apply a POSIX\-style lock to a file .SH "SYNOPSIS" .HP \w'int\ posix_lock_file('u .BI "int posix_lock_file(struct\ file\ *\ " "filp" ", struct\ file_lock\ *\ " "fl" ", struct\ file_lock\ *\ " "conflock" ");" .SH "ARGUMENTS" .PP \fIfilp\fR .RS 4 The file to apply the lock to .RE .PP \fIfl\fR .RS 4 The lock to be applied .RE .PP \fIconflock\fR .RS 4 Place to return a copy of the conflicting lock, if found\&. .RE .SH "DESCRIPTION" .PP Add a POSIX style lock to a file\&. We merge adjacent & overlapping locks whenever possible\&. POSIX locks are sorted by owner task, then by starting address .PP Note that if called with an FL_EXISTS argument, the caller may determine whether or not a lock was successfully freed by testing the return value for \-ENOENT\&. .SH "COPYRIGHT" .br