diff options
author | tjr <tjr@FreeBSD.org> | 2003-01-10 06:22:28 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-01-10 06:22:28 +0000 |
commit | 5e6eecbdf0598d50a80766d698324e918cb3cb7c (patch) | |
tree | bf0650d6b7ed7d7626d9426bd71cf682ea8ea53f /lib/libc/stdio/ferror.3 | |
parent | d8624a90a21f889b227fd945069f7b0cc9bf14b9 (diff) | |
download | FreeBSD-src-5e6eecbdf0598d50a80766d698324e918cb3cb7c.zip FreeBSD-src-5e6eecbdf0598d50a80766d698324e918cb3cb7c.tar.gz |
Document clearerr_unlocked(), feof_unlocked(), ferror_unlocked()
and fileno_unlocked().
Diffstat (limited to 'lib/libc/stdio/ferror.3')
-rw-r--r-- | lib/libc/stdio/ferror.3 | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/lib/libc/stdio/ferror.3 b/lib/libc/stdio/ferror.3 index b9968f1..cb170a4 100644 --- a/lib/libc/stdio/ferror.3 +++ b/lib/libc/stdio/ferror.3 @@ -36,14 +36,18 @@ .\" @(#)ferror.3 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 19, 1994 +.Dd January 10, 2003 .Dt FERROR 3 .Os .Sh NAME .Nm clearerr , +.Nm clearerr_unlocked , .Nm feof , +.Nm feof_unlocked , .Nm ferror , -.Nm fileno +.Nm ferror_unlocked , +.Nm fileno , +.Nm fileno_unlocked .Nd check and reset stream status .Sh LIBRARY .Lb libc @@ -51,12 +55,20 @@ .In stdio.h .Ft void .Fn clearerr "FILE *stream" +.Ft void +.Fn clearerr_unlocked "FILE *stream" .Ft int .Fn feof "FILE *stream" .Ft int +.Fn feof_unlocked "FILE *stream" +.Ft int .Fn ferror "FILE *stream" .Ft int +.Fn ferror_unlocked "FILE *stream" +.Ft int .Fn fileno "FILE *stream" +.Ft int +.Fn fileno_unlocked "FILE *stream" .Sh DESCRIPTION The function .Fn clearerr @@ -86,6 +98,25 @@ The function examines the argument .Fa stream and returns its integer descriptor. +.Pp +The +.Fn clearerr_unlocked , +.Fn feof_unlocked , +.Fn ferror_unlocked , +and +.Fn fileno_unlocked +functions are equivalent to +.Fn clearerr , +.Fn feof , +.Fn ferror , +and +.Fn fileno +respectively, except that the caller is responsible for locking the stream +with +.Fn flockfile +before calling them. +These functions may be used to avoid the overhead of locking the stream +and to prevent races when multiple threads are operating on the same stream. .Sh ERRORS These functions should not fail and do not set the external variable @@ -93,6 +124,7 @@ variable .Sh SEE ALSO .Xr open 2 , .Xr fdopen 3 , +.Xr flockfile 3 , .Xr stdio 3 .Sh STANDARDS The functions |