OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / stdio / ferror.c
1 /* Copyright (C) 2004       Manuel Novoa III    <mjn3@codepoet.org>
2  *
3  * GNU Library General Public License (LGPL) version 2 or later.
4  *
5  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
6  */
7
8 #include "_stdio.h"
9
10 #undef ferror
11 #ifdef __DO_UNLOCKED
12
13 #undef ferror_unlocked
14 int ferror_unlocked(register FILE *stream)
15 {
16         __STDIO_STREAM_VALIDATE(stream);
17
18         return __FERROR_UNLOCKED(stream);
19 }
20
21 #ifndef __UCLIBC_HAS_THREADS__
22 strong_alias(ferror_unlocked,ferror)
23 #endif
24
25 #elif defined __UCLIBC_HAS_THREADS__
26
27 int ferror(register FILE *stream)
28 {
29         int retval;
30         __STDIO_AUTO_THREADLOCK_VAR;
31
32         __STDIO_AUTO_THREADLOCK(stream);
33
34         __STDIO_STREAM_VALIDATE(stream);
35
36         retval = __FERROR_UNLOCKED(stream);
37
38         __STDIO_AUTO_THREADUNLOCK(stream);
39
40         return retval;
41 }
42
43 #endif