X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=man3%2Fflockfile.3;h=bfc9adcf4b9e5c54dc7cd94c531d4b43d04ec9b2;hp=8473fa9cf0e392228672f08e390f5135bbf13f36;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=8894c921674bb116d0a7b8f23a55311e7a768019 diff --git a/man3/flockfile.3 b/man3/flockfile.3 index 8473fa9..bfc9adc 100644 --- a/man3/flockfile.3 +++ b/man3/flockfile.3 @@ -1,56 +1,56 @@ -.\" This file is part of the Public Domain C Library (PDCLib). -.\" Permission is granted to use, modify, and / or redistribute at will. -.\" -.Dd -.Dt flockfile 3 -.Os -.\" -.Sh NAME -.Nm flockfile, ftrylockfile, funlockfile -.Nd stdio file locking -.\" -.Sh SYNOPSIS -.Sy #define _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || _SVID_SOURCE || _BSD_SOURCE -.\" -.In stdio.h -.Fn "void flockfile" "FILE *file" -.Fn "int ftrylockfile" "FILE *file" -.Fn "void funlockfile" "FILE *file" -.\" -.Sh DESCRIPTION -.Fn flockfile -locks the passed FILE stream for access by the calling thread, potentially -blocking. -.Fn ftrylockfile -attempts to lock the file for the calling thread, but will return failure if -another thread has already locked the file. -.Fn funlockfile -releases the lock on the stream, allowing another thread in the process to -access it. -.\" -.Pp -The same stream may be locked multiple times by the calling thread; the number -of calls to -.Fn flockfile -and -.Fn ftrylockfile -on a file must be equal to the number of calls to -.Fn funlockfile . -.\" -.Pp -No other thread may do I/O through the locked file while it is locked. -.\" -.Sh IMPLEMENTATION NOTES -PDCLib implements the file locking on top of the Mutex primitives added by C11 -.\" -.Sh SEE ALSO -.Xr fopen 3 -.Xr fclose 3 -.Xr unlocked_stdio 3 -.Xr mtx_t 3 -.\" -.Sh STANDARDS -The locked I/O routines were initially introduced in -.St -svid4 , -and incorporated into POSIX in +.\" This file is part of the Public Domain C Library (PDCLib). +.\" Permission is granted to use, modify, and / or redistribute at will. +.\" +.Dd +.Dt flockfile 3 +.Os +.\" +.Sh NAME +.Nm flockfile, ftrylockfile, funlockfile +.Nd stdio file locking +.\" +.Sh SYNOPSIS +.Sy #define _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || _SVID_SOURCE || _BSD_SOURCE +.\" +.In stdio.h +.Fn "void flockfile" "FILE *file" +.Fn "int ftrylockfile" "FILE *file" +.Fn "void funlockfile" "FILE *file" +.\" +.Sh DESCRIPTION +.Fn flockfile +locks the passed FILE stream for access by the calling thread, potentially +blocking. +.Fn ftrylockfile +attempts to lock the file for the calling thread, but will return failure if +another thread has already locked the file. +.Fn funlockfile +releases the lock on the stream, allowing another thread in the process to +access it. +.\" +.Pp +The same stream may be locked multiple times by the calling thread; the number +of calls to +.Fn flockfile +and +.Fn ftrylockfile +on a file must be equal to the number of calls to +.Fn funlockfile . +.\" +.Pp +No other thread may do I/O through the locked file while it is locked. +.\" +.Sh IMPLEMENTATION NOTES +PDCLib implements the file locking on top of the Mutex primitives added by C11 +.\" +.Sh SEE ALSO +.Xr fopen 3 +.Xr fclose 3 +.Xr unlocked_stdio 3 +.Xr mtx_t 3 +.\" +.Sh STANDARDS +The locked I/O routines were initially introduced in +.St -svid4 , +and incorporated into POSIX in .St -p1003.1-2001 . \ No newline at end of file