xref: /original-bsd/lib/libc/stdio/fputs.c (revision c6d5c0d7)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Chris Torek.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #if defined(LIBC_SCCS) && !defined(lint)
12 static char sccsid[] = "@(#)fputs.c	5.5 (Berkeley) 02/05/91";
13 #endif /* LIBC_SCCS and not lint */
14 
15 #include <sys/cdefs.h>
16 #include <stdio.h>
17 #include <string.h>
18 #include "fvwrite.h"
19 
20 /*
21  * Write the given string to the given file.
22  */
23 fputs(s, fp)
24 	const char *s;
25 	FILE *fp;
26 {
27 	struct __suio uio;
28 	struct __siov iov;
29 
30 	iov.iov_base = (void *)s;
31 	iov.iov_len = uio.uio_resid = strlen(s);
32 	uio.uio_iov = &iov;
33 	uio.uio_iovcnt = 1;
34 	return (__sfvwrite(fp, &uio));
35 }
36