summaryrefslogtreecommitdiff
path: root/libc/stdio/stdio.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-11-21 14:44:43 +0000
committerEric Andersen <andersen@codepoet.org>2001-11-21 14:44:43 +0000
commit14f7d9c3fd3fe0898e7479684a3733975101c290 (patch)
tree3ad99ff1a4119875268eb54e8640c357b23b7146 /libc/stdio/stdio.c
parent404978ea7c6f08fa302ea6318a1ea5db7705293d (diff)
Add missing ctermid. Also add putc and getc (in case they get
undefined which is a valid thing to do) -Erik
Diffstat (limited to 'libc/stdio/stdio.c')
-rw-r--r--libc/stdio/stdio.c19
1 files changed, 19 insertions, 0 deletions
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)