.\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
.\"
+.\" %%%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.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
-.TH FLOCKFILE 3 2008-08-29 "" "Linux Programmer's Manual"
+.TH FLOCKFILE 3 2013-07-23 "" "Linux Programmer's Manual"
.SH NAME
flockfile, ftrylockfile, funlockfile \- lock FILE for stdio
.SH SYNOPSIS
.ad l
.sp
All functions shown above:
+.RS 4
_POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE ||
_SVID_SOURCE || _POSIX_SOURCE
+.RE
.ad b
.SH DESCRIPTION
The stdio functions are thread-safe.
.LP
The
.BR flockfile ()
-function waits for \fI*filehandle\fP to be
+function waits for
+.I *filehandle
+to be
no longer locked by a different thread, then makes the
-current thread owner of \fI*filehandle\fP, and increments
+current thread owner of
+.IR *filehandle ,
+and increments
the lockcount.
.LP
The
of
.BR flockfile ().
It does nothing in case some other thread
-owns \fI*filehandle\fP, and it obtains ownership and increments
+owns
+.IR *filehandle ,
+and it obtains ownership and increments
the lockcount otherwise.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
The
.BR ftrylockfile ()
function returns zero for success
(the lock was obtained), and nonzero for failure.
.SH ERRORS
None.
-.SH "CONFORMING TO"
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR flockfile (),
+.BR ftrylockfile (),
+and
+.BR funlockfile ()
+functions are thread-safe.
+.SH CONFORMING TO
POSIX.1-2001.
.SH AVAILABILITY
These functions are available when
is defined.
They are in libc since libc 5.1.1 and in glibc
since glibc 2.0.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR unlocked_stdio (3)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.