]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/fputs.3.patch
Libc-583.tar.gz
[apple/libc.git] / stdio / FreeBSD / fputs.3.patch
1 --- fputs.3 2003-05-20 15:22:42.000000000 -0700
2 +++ fputs.3.edit 2006-07-13 09:28:07.000000000 -0700
3 @@ -48,14 +48,19 @@
4 .Sh SYNOPSIS
5 .In stdio.h
6 .Ft int
7 -.Fn fputs "const char *str" "FILE *stream"
8 +.Fo fputs
9 +.Fa "const char *restrict s"
10 +.Fa "FILE *restrict stream"
11 +.Fc
12 .Ft int
13 -.Fn puts "const char *str"
14 +.Fo puts
15 +.Fa "const char *s"
16 +.Fc
17 .Sh DESCRIPTION
18 The function
19 .Fn fputs
20 writes the string pointed to by
21 -.Fa str
22 +.Fa s
23 to the stream pointed to by
24 .Fa stream .
25 .\" The terminating
26 @@ -65,7 +70,7 @@
27 The function
28 .Fn puts
29 writes the string
30 -.Fa str ,
31 +.Fa s ,
32 and a terminating newline character,
33 to the stream
34 .Dv stdout .
35 @@ -97,6 +102,14 @@
36 .Va errno
37 for any of the errors specified for the routines
38 .Xr write 2 .
39 +.Sh COMPATIBILITY
40 +.Fn fputs
41 +now returns a non-negative number (as opposed to 0)
42 +on successful completion.
43 +As a result, many tests (e.g., "fputs() == 0", "fputs() != 0")
44 +do not give the desired result.
45 +Use "fputs() != EOF" or "fputs() == EOF"
46 +to determine success or failure.
47 .Sh SEE ALSO
48 .Xr ferror 3 ,
49 .Xr fputws 3 ,
50 @@ -109,3 +122,13 @@
51 .Fn puts
52 conform to
53 .St -isoC .
54 +While not mentioned in the standard, both
55 +.Fn fputs
56 +and
57 +.Fn puts
58 +print
59 +.Ql (null)
60 +if
61 +.Fa str
62 +is
63 +.Dv NULL .