]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/flockfile.3.patch
Libc-763.11.tar.gz
[apple/libc.git] / stdio / FreeBSD / flockfile.3.patch
1 --- _SB/Libc/stdio/FreeBSD/flockfile.3 2003-05-20 15:22:41.000000000 -0700
2 +++ _SB/Libc/stdio/FreeBSD/flockfile.3.edit 2006-06-28 16:55:52.000000000 -0700
3 @@ -37,21 +37,22 @@
4 .Sh SYNOPSIS
5 .In stdio.h
6 .Ft void
7 -.Fn flockfile "FILE *stream"
8 +.Fn flockfile "FILE *file"
9 .Ft int
10 -.Fn ftrylockfile "FILE *stream"
11 +.Fn ftrylockfile "FILE *file"
12 .Ft void
13 -.Fn funlockfile "FILE *stream"
14 +.Fn funlockfile "FILE *file"
15 .Sh DESCRIPTION
16 -These functions provide explicit application-level locking of stdio streams.
17 +These functions provide explicit application-level locking
18 +of stdio FILE objects.
19 They can be used to avoid output from multiple threads being interspersed,
20 input being dispersed among multiple readers, and to avoid the overhead
21 -of locking the stream for each operation.
22 +of locking the object for each operation.
23 .Pp
24 The
25 .Fn flockfile
26 -function acquires an exclusive lock on the specified stream.
27 -If another thread has already locked the stream,
28 +function acquires an exclusive lock on the specified object.
29 +If another thread has already locked the object,
30 .Fn flockfile
31 will block until the lock is released.
32 .Pp
33 @@ -65,19 +66,19 @@
34 .Pp
35 The
36 .Fn funlockfile
37 -function releases the lock on a stream acquired by an earlier call to
38 +function releases the lock on an object acquired by an earlier call to
39 .Fn flockfile
40 or
41 .Fn ftrylockfile .
42 .Pp
43 These functions behave as if there is a lock count associated
44 -with each stream.
45 +with each object.
46 Each time
47 .Fn flockfile
48 -is called on the stream, the count is incremented,
49 +is called on the object, the count is incremented,
50 and each time
51 .Fn funlockfile
52 -is called on the stream, the count is decremented.
53 +is called on the object, the count is decremented.
54 The lock is only actually released when the count reaches zero.
55 .Sh RETURN VALUES
56 The
57 @@ -89,7 +90,7 @@
58 The
59 .Fn ftrylockfile
60 function
61 -returns zero if the stream was successfully locked,
62 +returns zero if the object was successfully locked,
63 non-zero otherwise.
64 .Sh SEE ALSO
65 .Xr getc_unlocked 3 ,
66 @@ -97,7 +98,7 @@
67 .Sh STANDARDS
68 The
69 .Fn flockfile ,
70 -.Fn ftrylockfile
71 +.Fn ftrylockfile ,
72 and
73 .Fn funlockfile
74 functions conform to