diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-11-21 20:45:06 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-11-21 20:45:06 +0000 |
commit | 2b6e7ee637e81d7410a00f51653c5f66645a1a98 (patch) | |
tree | 3e5d7c3c0efea17365d7afbb369ad2f182b7712c /lib/libc/stdio | |
parent | 63a69e9d797ee37b46cc53233eeb398d8d67b544 (diff) |
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')
-rw-r--r-- | lib/libc/stdio/getchar.c | 17 | ||||
-rw-r--r-- | lib/libc/stdio/putchar.c | 19 |
2 files changed, 31 insertions, 5 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 diff --git a/lib/libc/stdio/putchar.c b/lib/libc/stdio/putchar.c index 22aa47aaefb..47480d494f3 100644 --- a/lib/libc/stdio/putchar.c +++ b/lib/libc/stdio/putchar.c @@ -35,11 +35,24 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: putchar.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: putchar.c,v 1.4 2002/11/21 20:45:05 marc Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> +#undef putchar_unlocked +/* + * A subrouting version of the macro putchar_unlocked + */ +int +putchar_unlocked(c) + int c; +{ + FILE *so = stdout; + + return (putc_unlocked(c,so)); +} + #undef putchar /* @@ -49,7 +62,7 @@ int putchar(c) int c; { - register FILE *so = stdout; + FILE *so = stdout; - return (__sputc(c, so)); + return (putc(c, so)); } |