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 link_warning(gets, "the 'gets' function is dangerous and should not be used.")
12 /* UNSAFE FUNCTION -- do not bother optimizing */
14 /* disable macro, force actual function call */
15 #undef getchar_unlocked
21 __STDIO_AUTO_THREADLOCK_VAR;
23 __STDIO_AUTO_THREADLOCK(stdin);
25 /* Note: don't worry about performance here... this shouldn't be used!
26 * Therefore, force actual function call. */
27 while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) {
30 if ((c == EOF) || (s == p)) {
36 __STDIO_AUTO_THREADUNLOCK(stdin);