blob: a96ecaa89167bd0daa334b6df967fab612615dd0 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* 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 clearerr
11#ifdef __DO_UNLOCKED
12
13#undef clearerr_unlocked
14void clearerr_unlocked(register FILE *stream)
15{
16 __STDIO_STREAM_VALIDATE(stream);
17
18 __CLEARERR_UNLOCKED(stream);
19}
20
21#ifndef __UCLIBC_HAS_THREADS__
22strong_alias(clearerr_unlocked,clearerr)
23#endif
24
25#elif defined __UCLIBC_HAS_THREADS__
26
27void clearerr(register FILE *stream)
28{
29 __STDIO_AUTO_THREADLOCK_VAR;
30
31 __STDIO_AUTO_THREADLOCK(stream);
32
33 __STDIO_STREAM_VALIDATE(stream);
34
35 __CLEARERR_UNLOCKED(stream);
36
37 __STDIO_AUTO_THREADUNLOCK(stream);
38}
39
40#endif