summaryrefslogtreecommitdiff
path: root/libc/stdio/getw.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdio/getw.c')
-rw-r--r--libc/stdio/getw.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libc/stdio/getw.c b/libc/stdio/getw.c
new file mode 100644
index 000000000..6b3b9e5e7
--- /dev/null
+++ b/libc/stdio/getw.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
+ *
+ * GNU Library General Public License (LGPL) version 2 or later.
+ *
+ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
+ */
+
+#include "_stdio.h"
+
+/* SUSv2 Legacy function -- need not be reentrant. */
+
+int getw(FILE *stream)
+{
+ int aw;
+
+ return (__fread_unlocked((void *) &aw, sizeof(int), 1, stream) != 0)
+ ? aw : EOF;
+}