-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) and
.\" and Copyright 2002 Michael Kerrisk
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
-
+.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified Fri Jan 31 16:26:07 1997 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified Fri Dec 11 17:57:27 1998 by Jamie Lokier <jamie@imbolc.ucc.ie>
.\"
.\" FIXME: Maybe document LOCK_MAND, LOCK_RW, LOCK_READ, LOCK_WRITE
.\" which only have effect for SAMBA.
-.TH FLOCK 2 2009-07-25 "Linux" "Linux Programmer's Manual"
+.\"
+.TH FLOCK 2 2014-04-22 "Linux" "Linux Programmer's Manual"
.SH NAME
flock \- apply or remove an advisory lock on an open file
.SH SYNOPSIS
may block if an incompatible lock is held by another process.
To make a nonblocking request, include
.B LOCK_NB
-(by
-.IR OR ing)
+(by ORing)
with any of the above operations.
A single file may not simultaneously have both shared and exclusive locks.
Locks created by
.BR flock ()
-are associated with an open file table entry.
+are associated with an open file description (see
+.BR open (2)).
This means that duplicate file descriptors (created by, for example,
.BR fork (2)
or
may be denied by a lock that the calling process has
already placed via another descriptor.
-A process may only hold one type of lock (shared or exclusive)
+A process may hold only one type of lock (shared or exclusive)
on a file.
Subsequent
.BR flock ()
A shared or exclusive lock can be placed on a file regardless of the
mode in which the file was opened.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On success, zero is returned.
On error, \-1 is returned, and
.I errno
The file is locked and the
.B LOCK_NB
flag was selected.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
4.4BSD (the
.BR flock ()
call first appeared in 4.2BSD).
and occurs on many other implementations.)
.\" Kernel 2.5.21 changed things a little: during lock conversion
.\" it is now the highest priority process that will get the lock -- mtk
-.SH "SEE ALSO"
+.SH SEE ALSO
+.BR flock (1),
.BR close (2),
.BR dup (2),
.BR execve (2),
.BR open (2),
.BR lockf (3)
-See also
-.I Documentation/filesystem/locks.txt
-in the kernel source
+.I Documentation/filesystems/locks.txt
+in the Linux kernel source tree
.RI ( Documentation/locks.txt
-in older kernels).
+in older kernels)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.