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.
14 wchar_t *fgetws_unlocked(wchar_t *__restrict ws
, int n
,
15 FILE *__restrict stream
)
17 register wchar_t *p
= ws
;
20 __STDIO_STREAM_VALIDATE(stream
);
23 && ((wi
= fgetwc_unlocked(stream
)) != WEOF
)
24 && ((*p
++ = wi
) != '\n')
29 /* TODO -- should we set errno? */
38 libc_hidden_def(fgetws_unlocked
)
40 #ifndef __UCLIBC_HAS_THREADS__
41 strong_alias(fgetws_unlocked
,fgetws
)
44 #elif defined __UCLIBC_HAS_THREADS__
46 wchar_t *fgetws(wchar_t *__restrict ws
, int n
, FILE *__restrict stream
)
49 __STDIO_AUTO_THREADLOCK_VAR
;
51 __STDIO_AUTO_THREADLOCK(stream
);
53 retval
= fgetws_unlocked(ws
, n
, stream
);
55 __STDIO_AUTO_THREADUNLOCK(stream
);