summaryrefslogtreecommitdiffstats
path: root/include/stdio.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-08-13 21:48:44 +0000
committerpeter <peter@FreeBSD.org>2001-08-13 21:48:44 +0000
commit3e5894fd23a47dea1c37133433e493126bb1cd21 (patch)
treee06c967bdb858227175cd2821c4ca0634e645306 /include/stdio.h
parent74c140cf82c44db573799d0833dbc1919b41be89 (diff)
downloadFreeBSD-src-3e5894fd23a47dea1c37133433e493126bb1cd21.zip
FreeBSD-src-3e5894fd23a47dea1c37133433e493126bb1cd21.tar.gz
Rip out the old __stdin/out/err stuff. It was completely 100% useless. :-(
It was foiled because of dynamic copy relocations that caused compile-time space to be reserved in .bss and at run time a blob of data was copied to that space and everything used the .bss version.. The problem is that the space is reserved at compile time, not runtime... So we *still* could not change the size of FILE. Sigh. :-( Replace it with something that does actually work and really does let us make 'FILE' extendable. It also happens to be the same as Linux does in glibc, but has the slight cost of a pointer. Note that this is the same cost that 'fp = fopen(), fprintf(fp, ...); fclose(fp);' has. Fortunately, actual references to stdin/out/err are not all that common since we have implicit stdin/out/err-using versions of functions (printf() vs. fprintf()).
Diffstat (limited to 'include/stdio.h')
-rw-r--r--include/stdio.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 431eab0..d60ed88 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -132,6 +132,9 @@ typedef struct __sFILE {
__BEGIN_DECLS
extern FILE __sF[];
+extern FILE *__stdinp;
+extern FILE *__stdoutp;
+extern FILE *__stderrp;
__END_DECLS
#define __SLBF 0x0001 /* line buffered */
@@ -194,9 +197,16 @@ __END_DECLS
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
+/* To be removed by 5.0-RELEASE */
+#if (defined(__i386__) || defined(__alpha__)) && !defined(_FIXED_STDIO)
#define stdin (&__sF[0])
#define stdout (&__sF[1])
#define stderr (&__sF[2])
+#else
+#define stdin __stdinp
+#define stdout __stdoutp
+#define stderr __stderrp
+#endif
/*
* Functions defined in ANSI C standard.
OpenPOWER on IntegriCloud