Update contrib.
3 * Portions Copyright (c) 1990-2006 Nokia Corporation and/or its subsidiary(-ies).
8 * Copyright (c) 1990 The Regents of the University of California.
11 * Redistribution and use in source and binary forms are permitted
12 * provided that the above copyright notice and this paragraph are
13 * duplicated in all such forms and that any documentation,
14 * advertising materials, and other materials related to such
15 * distribution and use acknowledge that the software was developed
16 * by the University of California, Berkeley. The name of the
17 * University may not be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26 <<puts>>---write a character string
35 int puts(const char *<[s]>);
37 int _puts_r(void *<[reent]>, const char *<[s]>);
44 int _puts_r(<[reent]>, <[s]>)
49 <<puts>> writes the string at <[s]> (followed by a newline, instead of
50 the trailing null) to the standard output stream.
52 The alternate function <<_puts_r>> is a reentrant version. The extra
53 argument <[reent]> is a pointer to a reentrancy structure.
56 If successful, the result is a nonnegative integer; otherwise, the
60 ANSI C requires <<puts>>, but does not specify that the result on
61 success must be <<0>>; any non-negative value is permitted.
63 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
64 <<lseek>>, <<read>>, <<sbrk>>, <<write>>. */
72 Writes the given string to stdout, appending a newline.
77 _puts_r (struct _reent *ptr, const char * s)
79 size_t c = strlen (s);
85 iov[1].iov_base = "\n";
87 uio.uio_resid = c + 1;
88 uio.uio_iov = &iov[0];
91 return (__sfvwrite (_stdout_r (ptr), &uio) ? EOF : '\n');
96 Outputs a string to stdout. Copies the string to standard output stream
97 and appends a new line character (\n).
99 @param Null-terminated string to be outputed.
101 @return On Success, a non-negative value is returned.
102 On Failure, EOF value is returned and errno may be set.
105 puts (char const * s)
107 struct _reent *r = _REENT2;
109 return EOF; // Memory for library globals is not allocated (errno not set).
110 return _puts_r (r, s);