fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / stdio / putc_u.c
bloba3c0e0864e6647ea2f5a2b0705e297ddf6a4be29
1 /*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms are permitted
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 FUNCTION
20 <<putc_unlocked>>---non-thread-safe version of putc (macro)
22 INDEX
23 putc_unlocked
25 POSIX_SYNOPSIS
26 #include <stdio.h>
27 int putc_unlocked(int <[ch]>, FILE *<[fp]>);
29 DESCRIPTION
30 <<putc_unlocked>> is a non-thread-safe version of <<putc>> declared in
31 <<stdio.h>>. <<putc_unlocked>> may only safely be used within a scope
32 protected by flockfile() (or ftrylockfile()) and funlockfile(). These
33 functions may safely be used in a multi-threaded program if and only
34 if they are called while the invoking thread owns the ( FILE *)
35 object, as is the case after a successful call to the flockfile() or
36 ftrylockfile() functions. If threads are disabled, then
37 <<putc_unlocked>> is equivalent to <<putc>>.
39 RETURNS
40 See <<putc>>.
42 PORTABILITY
43 POSIX 1003.1 requires <<putc_unlocked>>. <<putc_unlocked>> may be
44 implemented as a macro, so arguments should not have side-effects.
46 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
47 <<lseek>>, <<read>>, <<sbrk>>, <<write>>. */
49 #if defined(LIBC_SCCS) && !defined(lint)
50 static char sccsid[] = "%W% (Berkeley) %G%";
51 #endif /* LIBC_SCCS and not lint */
53 #include <stdio.h>
56 * A subroutine version of the macro putc_unlocked.
59 #undef putc_unlocked
61 int
62 putc_unlocked (c, fp)
63 int c;
64 register FILE *fp;
66 /* CHECK_INIT is (eventually) called by __swbuf. */
68 return __sputc (c, fp);