1 /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
3 * GNU Library General Public License (LGPL) version 2 or later.
5 * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
10 libc_hidden_proto(fgetws_unlocked)
12 libc_hidden_proto(fgetwc_unlocked)
16 wchar_t *fgetws_unlocked(wchar_t *__restrict ws, int n,
17 FILE *__restrict stream)
19 register wchar_t *p = ws;
22 __STDIO_STREAM_VALIDATE(stream);
25 && ((wi = fgetwc_unlocked(stream)) != WEOF)
26 && ((*p++ = wi) != '\n')
31 /* TODO -- should we set errno? */
40 libc_hidden_def(fgetws_unlocked)
42 #ifndef __UCLIBC_HAS_THREADS__
43 strong_alias(fgetws_unlocked,fgetws)
46 #elif defined __UCLIBC_HAS_THREADS__
48 wchar_t *fgetws(wchar_t *__restrict ws, int n, FILE *__restrict stream)
51 __STDIO_AUTO_THREADLOCK_VAR;
53 __STDIO_AUTO_THREADLOCK(stream);
55 retval = fgetws_unlocked(ws, n, stream);
57 __STDIO_AUTO_THREADUNLOCK(stream);