-.\" $NetBSD: lockf.3,v 1.2 1998/02/05 18:47:28 perry Exp $
+.\" $NetBSD: lockf.3,v 1.10 2008/04/30 13:10:50 martin Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the NetBSD
-.\" Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\" contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libc/gen/lockf.3,v 1.13 2004/07/02 23:52:10 ru Exp $
+.\" $FreeBSD: src/lib/libc/gen/lockf.3,v 1.14 2009/03/04 01:01:26 delphij Exp $
.\"
.Dd December 19, 1997
.Dt LOCKF 3
.Sh SYNOPSIS
.In unistd.h
.Ft int
-.Fn lockf "int filedes" "int function" "off_t size"
+.Fn lockf "int fildes" "int function" "off_t size"
.Sh DESCRIPTION
The
.Fn lockf
.Fn lockf
from other processes which attempt to lock the locked file section will
either return an error value or block until the section becomes unlocked.
-All the locks for a process are removed when the process terminates.
+All of the locks for a process are removed when the process terminates.
.Pp
The argument
-.Fa filedes
+.Fa fildes
is an open file descriptor.
The file descriptor must have been opened either for write-only
.Dv ( O_WRONLY )
and the section is already locked by another process.
.It Bq Er EBADF
The argument
-.Fa filedes
+.Fa fildes
is not a valid open file descriptor.
.Pp
The argument
or
.Dv F_TLOCK ,
and
-.Fa filedes
+.Fa fildes
is not a valid file descriptor open for writing.
.It Bq Er EDEADLK
The argument
The argument
.Fa function
is not one of
-.Dv F_ULOCK ,
.Dv F_LOCK ,
-.Dv F_TLOCK
+.Dv F_TEST ,
+.Dv F_TLOCK ,
or
-.Dv F_TEST .
+.Dv F_ULOCK .
.Pp
The argument
-.Fa filedes
-refers to a file that does not support locking.
+.Fa fildes
+refers to a file that does not support advisory locking.
.It Bq Er ENOLCK
The argument
.Fa function
is
-.Dv F_ULOCK ,
-.Dv F_LOCK
-or
+.Dv F_LOCK ,
.Dv F_TLOCK ,
+or
+.Dv F_ULOCK
and satisfying the lock or unlock request would result in the number
of locked regions in the system exceeding a system-imposed limit.
+.It Bq Er EOPNOTSUPP
+The argument
+.Fa fildes
+refers to a socket; these do not support advisory locking.
.El
.Sh SEE ALSO
.Xr fcntl 2 ,