1.\" Copyright (c) 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Chris Torek and the American National Standards Committee X3, 6.\" on Information Processing Systems. 7.\" 8.\" %sccs.include.redist.man% 9.\" 10.\" @(#)fputs.3 8.1 (Berkeley) 06/04/93 11.\" 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 38writes the string 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 49on error; 50.Fn puts 51returns a nonnegative integer on success and 52.Dv EOF 53on error. 54.Sh ERRORS 55.Bl -tag -width [EBADF] 56.It Bq Er EBADF 57The 58.Fa stream 59supplied 60is not a writable stream. 61.El 62.Pp 63The functions 64.Fn fputs 65and 66.Fn puts 67may also fail and set 68.Va errno 69for any of the errors specified for the routines 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 78and 79.Fn puts 80conform to 81.St -ansiC . 82