date and time created 91/03/07 10:23:53 by bostic
[unix-history] / usr / src / lib / libc / stdio / fputs.3
CommitLineData
8937b634
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
85d99438 3.\"
8937b634
KB
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek.
6.\"
7.\" %sccs.include.redist.man%
8.\"
9.\" @(#)fputs.3 6.3 (Berkeley) %G%
10.\"
11.TH FPUTS 3 ""
12.UC 7
85d99438 13.SH NAME
8937b634 14fputs, puts \- put a line to a stream
85d99438 15.SH SYNOPSIS
8937b634
KB
16.nf
17.ft B
18#include <stdio.h>
19
20int
21fputs(char *str, FILE *stream);
22
23int
24puts(char *str);
25.ft R
26.fi
85d99438 27.SH DESCRIPTION
85d99438 28.I Fputs
8937b634
KB
29writes the string
30.I str
31to the given
85d99438
KM
32.IR stream .
33.PP
85d99438 34.I Puts
8937b634
KB
35writes the string
36.I str
37to the standard output stream
38.BR stdout ,
39appending a newline character.
40.SH "RETURN VALUE"
41.I Fputs
42returns 0 on success,
43.B EOF
44on error;
45.I puts
46returns a nonnegative integer on success,
47.B EOF
48on error.
49.SH "SEE ALSO"
50putc(3), ferror(3), stdio(3)
51.SH ERRORS
52.TP 15
53[EBADF]
54.I Stream
55is not a writable stream.
56.PP
57.I Fputs
58and
59.I puts
60may also fail and set
61.I errno
62for any of the errors specified for the routines
63.IR write (2).
64.SH STANDARDS
65.I Fputs
66and
67.I puts
68conform to ANSI X3.159-1989 (``ANSI C'').