OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man3 / lockf.3
index 3da9dda..197e1dc 100644 (file)
@@ -1,6 +1,7 @@
-.\" Copyright 1997 Nicolás Lichtmaier <nick@debian.org>
+.\" Copyright 1997 Nicolás Lichtmaier <nick@debian.org>
 .\" Created Thu Aug  7 00:44:00 ART 1997
 .\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
 .\" This is free documentation; you can redistribute it and/or
 .\" modify it under the terms of the GNU General Public License as
 .\" published by the Free Software Foundation; either version 2 of
 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 .\" GNU General Public License for more details.
 .\"
+.\" You should have received a copy of the GNU General Public
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
+.\"
 .\" Added section stuff, aeb, 2002-04-22.
 .\" Corrected include file, drepper, 2003-06-15.
 .\"
-.TH LOCKF 3 2009-07-25 "GNU" "Linux Programmer's Manual"
+.TH LOCKF 3 2014-06-13 "GNU" "Linux Programmer's Manual"
 .SH NAME
 lockf \- apply, test or remove a POSIX lock on an open file
 .SH SYNOPSIS
@@ -33,7 +39,12 @@ Feature Test Macro Requirements for glibc (see
 .in
 .sp
 .BR lockf ():
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500
+.ad l
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
+_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+.RE
+.ad
 .SH DESCRIPTION
 Apply, test or remove a POSIX lock on a section of an open file.
 The file is specified by
@@ -102,7 +113,7 @@ to
 .RB ( EACCES
 on some other systems),
 if another process holds a lock.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 On success, zero is returned.
 On error, \-1 is returned, and
 .I errno
@@ -119,34 +130,55 @@ been memory-mapped by another process.
 .TP
 .B EBADF
 .I fd
-is not an open file descriptor.
+is not an open file descriptor; or
+.I cmd
+is
+.B F_LOCK
+or
+.BR F_TLOCK
+and
+.I fd
+is not a writable file descriptor.
 .TP
 .B EDEADLK
 The command was
-.B T_LOCK
+.B F_LOCK
 and this lock operation would cause a deadlock.
 .TP
 .B EINVAL
 An invalid operation was specified in
-.IR fd .
+.IR cmd .
 .TP
 .B ENOLCK
 Too many segment locks open, lock table is full.
-.SH "CONFORMING TO"
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR lockf ()
+function is thread-safe.
+.SH CONFORMING TO
 SVr4, POSIX.1-2001.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR fcntl (2),
 .BR flock (2)
-.br
-There are also
+
 .I locks.txt
 and
 .I mandatory-locking.txt
-in the kernel source directory
-.IR Documentation/filesystems .
-(On older kernels, these files are directly under the
-.I Documentation/
+in the Linux kernel source directory
+.IR Documentation/filesystems
+(on older kernels, these files are directly under the
+.I Documentation
 directory, and
 .I mandatory-locking.txt
 is called
-.IR mandatory.txt .)
+.IR mandatory.txt )
+.SH COLOPHON
+This page is part of release 3.79 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/.