fputs.c (92986) | fputs.c (101776) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 24 unchanged lines hidden (view full) --- 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93"; 39#endif /* LIBC_SCCS and not lint */ 40#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 24 unchanged lines hidden (view full) --- 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93"; 39#endif /* LIBC_SCCS and not lint */ 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/lib/libc/stdio/fputs.c 92986 2002-03-22 21:53:29Z obrien $"); | 41__FBSDID("$FreeBSD: head/lib/libc/stdio/fputs.c 101776 2002-08-13 09:30:41Z tjr $"); |
42 43#include "namespace.h" 44#include <stdio.h> 45#include <string.h> 46#include "un-namespace.h" 47#include "fvwrite.h" 48#include "libc_private.h" | 42 43#include "namespace.h" 44#include <stdio.h> 45#include <string.h> 46#include "un-namespace.h" 47#include "fvwrite.h" 48#include "libc_private.h" |
49#include "local.h" |
|
49 50/* 51 * Write the given string to the given file. 52 */ 53int 54fputs(s, fp) 55 const char *s; 56 FILE *fp; 57{ 58 int retval; 59 struct __suio uio; 60 struct __siov iov; 61 62 iov.iov_base = (void *)s; 63 iov.iov_len = uio.uio_resid = strlen(s); 64 uio.uio_iov = &iov; 65 uio.uio_iovcnt = 1; 66 FLOCKFILE(fp); | 50 51/* 52 * Write the given string to the given file. 53 */ 54int 55fputs(s, fp) 56 const char *s; 57 FILE *fp; 58{ 59 int retval; 60 struct __suio uio; 61 struct __siov iov; 62 63 iov.iov_base = (void *)s; 64 iov.iov_len = uio.uio_resid = strlen(s); 65 uio.uio_iov = &iov; 66 uio.uio_iovcnt = 1; 67 FLOCKFILE(fp); |
68 ORIENT(fp, -1); |
|
67 retval = __sfvwrite(fp, &uio); 68 FUNLOCKFILE(fp); 69 return (retval); 70} | 69 retval = __sfvwrite(fp, &uio); 70 FUNLOCKFILE(fp); 71 return (retval); 72} |