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