summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/getchar.c
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2002-11-21 20:45:05 +0000
committermarc <marc@openbsd.org>2002-11-21 20:45:05 +0000
commitb418cc483f2c538a9dd6353a9d96390b80bb70cb (patch)
treed4cc57fe6ee5d13c58974e747235433942f3b53a /lib/libc/stdio/getchar.c
parentadd prototype for strerror_r (diff)
downloadwireguard-openbsd-b418cc483f2c538a9dd6353a9d96390b80bb70cb.tar.xz
wireguard-openbsd-b418cc483f2c538a9dd6353a9d96390b80bb70cb.zip
Add strerror_r and functions versions of getchar_unlocked and
putchar_unlocked. Crank the minor on related libs. OK fgs@, deraadt@
Diffstat (limited to 'lib/libc/stdio/getchar.c')
-rw-r--r--lib/libc/stdio/getchar.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/libc/stdio/getchar.c b/lib/libc/stdio/getchar.c
index 029f19f94fd..4590d1abd29 100644
--- a/lib/libc/stdio/getchar.c
+++ b/lib/libc/stdio/getchar.c
@@ -35,13 +35,26 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getchar.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: getchar.c,v 1.4 2002/11/21 20:45:05 marc Exp $";
#endif /* LIBC_SCCS and not lint */
+#include <stdio.h>
+
+/*
+ * A subroutine version of the macro getchar_unlocked.
+ */
+#undef getchar_unlocked
+
+int
+getchar_unlocked()
+{
+ return (getc_unlocked(stdin));
+}
+
+
/*
* A subroutine version of the macro getchar.
*/
-#include <stdio.h>
#undef getchar