summaryrefslogtreecommitdiffstats
path: root/include/stdio.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-02-16 06:11:22 +0000
committerimp <imp@FreeBSD.org>2001-02-16 06:11:22 +0000
commit51cffb6bac86b91ac5ec606a7c085d25242b8a7e (patch)
tree89de43324c841cd9d2a9fe23a5b1531d67fed290 /include/stdio.h
parent778f80298c10621f10b64d201250c6fcb00793d8 (diff)
downloadFreeBSD-src-51cffb6bac86b91ac5ec606a7c085d25242b8a7e.zip
FreeBSD-src-51cffb6bac86b91ac5ec606a7c085d25242b8a7e.tar.gz
Fix the current libc breakage in current:
o Back out the __std* stuff. Can't figure out how to do this right now, so we'll save it for late. o use _up as a pointer for extra fields that we need to access. o back out the libc major version bump. Submitted by: green reviewed by: peter, imp, green, obrien (to varying degrees). We'll fix the "how do we stop encoding sizeof(FILE) in binaries" part later.
Diffstat (limited to 'include/stdio.h')
-rw-r--r--include/stdio.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/stdio.h b/include/stdio.h
index a5de1de..a8aaf6d 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -70,6 +70,12 @@ struct __sbuf {
struct __file_lock;
+/* hold a buncha junk that would grow the ABI */
+struct __sFILEX {
+ struct __file_lock *_mtlock; /* used for MT-safety */
+ unsigned char *_up; /* saved _p when _p is doing ungetc data */
+};
+
/*
* stdio state variables.
*
@@ -114,7 +120,7 @@ typedef struct __sFILE {
/* separate buffer for long sequences of ungetc() */
struct __sbuf _ub; /* ungetc buffer */
- unsigned char *_up; /* saved _p when _p is doing ungetc data */
+ struct __sFILEX *_extra; /* additions to FILE to not break ABI */
int _ur; /* saved _r when _r is counting ungetc data */
/* tricks to meet minimum requirements even when malloc() fails */
@@ -127,13 +133,10 @@ typedef struct __sFILE {
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
fpos_t _offset; /* current lseek offset (see WARNING) */
- struct __file_lock *_lock; /* used for MT-safety */
} FILE;
__BEGIN_DECLS
-extern FILE __stdin;
-extern FILE __stdout;
-extern FILE __stderr;
+extern FILE __sF[];
__END_DECLS
#define __SLBF 0x0001 /* line buffered */
@@ -196,9 +199,9 @@ __END_DECLS
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
-#define stdin (&__stdin)
-#define stdout (&__stdout)
-#define stderr (&__stderr)
+#define stdin (&__sF[0])
+#define stdout (&__sF[1])
+#define stderr (&__sF[2])
/*
* Functions defined in ANSI C standard.
OpenPOWER on IntegriCloud