From 14f7d9c3fd3fe0898e7479684a3733975101c290 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 21 Nov 2001 14:44:43 +0000 Subject: Add missing ctermid. Also add putc and getc (in case they get undefined which is a valid thing to do) -Erik --- libc/stdio/stdio.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libc/stdio/stdio.c') diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c index f87a69416..d35dd7a66 100644 --- a/libc/stdio/stdio.c +++ b/libc/stdio/stdio.c @@ -1000,6 +1000,25 @@ FILE *fdopen(int fd, __const char *mode) } #endif + +#ifdef L_getc +#undef getc +int getc(FILE *stream) +{ + return(((stream)->bufpos >= (stream)->bufread)? fgetc(stream) : + (*(stream)->bufpos++)); +} +#endif + +#ifdef L_putc +#undef putc +int putc(int c, FILE *stream) +{ + return(((stream)->bufpos >= (stream)->bufwrite)? fputc((c), (stream)) : + (unsigned char) (*(stream)->bufpos++ = (c)) ); +} +#endif + #ifdef L_getchar #undef getchar int getchar(void) -- cgit v1.2.3