xref: /original-bsd/lib/libc/stdio/fputs.3 (revision ba762ddc)
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek.
6.\" %sccs.include.redist.man%
7.\"
8.\"     @(#)fputs.3	6.5 (Berkeley) 04/19/91
9.\"
10.Dd
11.Dt FPUTS 3
12.Os
13.Sh NAME
14.Nm fputs ,
15.Nm puts
16.Nd output a line to a stream
17.Sh SYNOPSIS
18.Fd #include <stdio.h>
19.Ft int
20.Fn fputs "const char *str" "FILE *stream"
21.Ft int
22.Fn puts "const char *str"
23.Sh DESCRIPTION
24The function
25.Fn fputs
26writes the string pointed to by
27.Fa str
28to the stream pointed to by
29.Fa stream .
30.\" The terminating
31.\" .Dv NUL
32.\" character is not written.
33.Pp
34The function
35.Fn puts
36writes the string
37.Fa str ,
38and a terminating newline character,
39to the stream
40.Em stdout .
41.Sh RETURN VALUES
42The
43.Fn fputs
44function
45returns 0 on success and
46.Dv EOF
47on error;
48.Fn puts
49returns a nonnegative integer on success and
50.Dv EOF
51on error.
52.Sh ERRORS
53.Bl -tag -width [EBADF]
54.It Bq Er EBADF
55The
56.Fa stream
57supplied
58is not a writable stream.
59.El
60.Pp
61The functions
62.Fn fputs
63and
64.Fn puts
65may also fail and set
66.Va errno
67for any of the errors specified for the routines
68.Xr write 2 .
69.Sh SEE ALSO
70.Xr putc 3 ,
71.Xr ferror 3 ,
72.Xr stdio 3
73.Sh STANDARDS
74The functions
75.Fn fputs
76and
77.Fn puts
78conform to
79.St -ansiC .
80