Loading...
stdio/fputs.3 Libc-262.2.12 Libc-583
--- Libc/Libc-262.2.12/stdio/fputs.3
+++ Libc/Libc-583/stdio/fputs.3
@@ -34,7 +34,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)fputs.3	8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.8 2001/10/01 16:08:59 ru Exp $
+.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.11 2002/12/19 09:40:24 ru Exp $
 .\"
 .Dd June 4, 1993
 .Dt FPUTS 3
@@ -48,14 +48,19 @@
 .Sh SYNOPSIS
 .In stdio.h
 .Ft int
-.Fn fputs "const char *str" "FILE *stream"
+.Fo fputs
+.Fa "const char *restrict s"
+.Fa "FILE *restrict stream"
+.Fc
 .Ft int
-.Fn puts "const char *str"
+.Fo puts
+.Fa "const char *s"
+.Fc
 .Sh DESCRIPTION
 The function
 .Fn fputs
 writes the string pointed to by
-.Fa str
+.Fa s
 to the stream pointed to by
 .Fa stream .
 .\" The terminating
@@ -65,10 +70,10 @@
 The function
 .Fn puts
 writes the string
-.Fa str ,
+.Fa s ,
 and a terminating newline character,
 to the stream
-.Em stdout .
+.Dv stdout .
 .Sh RETURN VALUES
 The
 .Fn fputs
@@ -85,7 +90,7 @@
 .It Bq Er EBADF
 The
 .Fa stream
-supplied
+argument
 is not a writable stream.
 .El
 .Pp
@@ -97,8 +102,17 @@
 .Va errno
 for any of the errors specified for the routines
 .Xr write 2 .
+.Sh COMPATIBILITY
+.Fn fputs
+now returns a non-negative number (as opposed to 0)
+on successful completion.
+As a result, many tests (e.g., "fputs() == 0", "fputs() != 0")
+do not give the desired result.
+Use "fputs() != EOF" or "fputs() == EOF"
+to determine success or failure.
 .Sh SEE ALSO
 .Xr ferror 3 ,
+.Xr fputws 3 ,
 .Xr putc 3 ,
 .Xr stdio 3
 .Sh STANDARDS
@@ -108,3 +122,13 @@
 .Fn puts
 conform to
 .St -isoC .
+While not mentioned in the standard, both
+.Fn fputs
+and
+.Fn puts
+print
+.Ql (null)
+if
+.Fa str
+is
+.Dv NULL .