Deleted Added
full compact
fputs.c (249808) fputs.c (249810)
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

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93";
35#endif /* LIBC_SCCS and not lint */
36#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

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/lib/libc/stdio/fputs.c 249808 2013-04-23 13:33:13Z emaste $");
37__FBSDID("$FreeBSD: head/lib/libc/stdio/fputs.c 249810 2013-04-23 14:36:44Z emaste $");
38
39#include "namespace.h"
40#include <stdio.h>
41#include <string.h>
42#include "un-namespace.h"
43#include "fvwrite.h"
44#include "libc_private.h"
45#include "local.h"
46
47/*
48 * Write the given string to the given file.
49 */
50int
38
39#include "namespace.h"
40#include <stdio.h>
41#include <string.h>
42#include "un-namespace.h"
43#include "fvwrite.h"
44#include "libc_private.h"
45#include "local.h"
46
47/*
48 * Write the given string to the given file.
49 */
50int
51fputs(s, fp)
52 const char * __restrict s;
53 FILE * __restrict fp;
51fputs(const char * __restrict s, FILE * __restrict fp)
54{
55 int retval;
56 struct __suio uio;
57 struct __siov iov;
58
59 iov.iov_base = (void *)s;
60 iov.iov_len = uio.uio_resid = strlen(s);
61 uio.uio_iov = &iov;
62 uio.uio_iovcnt = 1;
63 FLOCKFILE(fp);
64 ORIENT(fp, -1);
65 retval = __sfvwrite(fp, &uio);
66 FUNLOCKFILE(fp);
67 return (retval);
68}
52{
53 int retval;
54 struct __suio uio;
55 struct __siov iov;
56
57 iov.iov_base = (void *)s;
58 iov.iov_len = uio.uio_resid = strlen(s);
59 uio.uio_iov = &iov;
60 uio.uio_iovcnt = 1;
61 FLOCKFILE(fp);
62 ORIENT(fp, -1);
63 retval = __sfvwrite(fp, &uio);
64 FUNLOCKFILE(fp);
65 return (retval);
66}