X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..ad3c9f2af814c84582fdd1649e49ec4f68572c5a:/stdio/FreeBSD/fputs.3?ds=sidebyside diff --git a/stdio/FreeBSD/fputs.3 b/stdio/FreeBSD/fputs.3 index a0c0341..4c4ca1e 100644 --- a/stdio/FreeBSD/fputs.3 +++ b/stdio/FreeBSD/fputs.3 @@ -13,10 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. @@ -34,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)fputs.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.11 2002/12/19 09:40:24 ru Exp $ +.\" $FreeBSD: src/lib/libc/stdio/fputs.3,v 1.14 2007/04/19 14:01:04 phk Exp $ .\" .Dd June 4, 1993 .Dt FPUTS 3 @@ -48,14 +44,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,19 +66,16 @@ to the stream pointed to by The function .Fn puts writes the string -.Fa str , +.Fa s , and a terminating newline character, to the stream .Dv stdout . .Sh RETURN VALUES -The +The functions .Fn fputs -function -returns 0 on success and -.Dv EOF -on error; +and .Fn puts -returns a nonnegative integer on success and +return a nonnegative integer on success and .Dv EOF on error. .Sh ERRORS @@ -97,6 +95,14 @@ may also fail and set .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 , @@ -109,3 +115,13 @@ and .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 .