xref: /csrg-svn/lib/libc/stdio/fputs.c (revision 46271)
146082Sbostic /*-
246082Sbostic  * Copyright (c) 1990 The Regents of the University of California.
346082Sbostic  * All rights reserved.
446082Sbostic  *
546082Sbostic  * This code is derived from software contributed to Berkeley by
646082Sbostic  * Chris Torek.
746082Sbostic  *
846082Sbostic  * %sccs.include.redist.c%
922133Smckusick  */
1022133Smckusick 
1126650Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*46271Storek static char sccsid[] = "@(#)fputs.c	5.5 (Berkeley) 02/05/91";
1346082Sbostic #endif /* LIBC_SCCS and not lint */
1422133Smckusick 
1546212Sbostic #include <sys/cdefs.h>
1646082Sbostic #include <stdio.h>
1746082Sbostic #include <string.h>
1846082Sbostic #include "fvwrite.h"
192007Swnj 
2046082Sbostic /*
2146082Sbostic  * Write the given string to the given file.
2246082Sbostic  */
2346082Sbostic fputs(s, fp)
24*46271Storek 	const char *s;
2546082Sbostic 	FILE *fp;
262007Swnj {
2746082Sbostic 	struct __suio uio;
2846082Sbostic 	struct __siov iov;
292007Swnj 
30*46271Storek 	iov.iov_base = (void *)s;
3146082Sbostic 	iov.iov_len = uio.uio_resid = strlen(s);
3246082Sbostic 	uio.uio_iov = &iov;
3346082Sbostic 	uio.uio_iovcnt = 1;
3446082Sbostic 	return (__sfvwrite(fp, &uio));
352007Swnj }
36