Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Green <mrg@redhat.com>2002-02-03 12:24:18 +0300
committerMatthew Green <mrg@redhat.com>2002-02-03 12:24:18 +0300
commit8195aff714f2ea5d680a5129a1d54af388e90355 (patch)
tree683ff47f4802385e669491dda42bf8050772dbdf /newlib/libc/stdio/findfp.c
parentad67ada2fc7cdb361643d506701e274a67d796f9 (diff)
* implement a new `struct _reent' that is significantly smaller. use this
if _REENT_SMALL is defined in config.h. define this for xstormy16.
Diffstat (limited to 'newlib/libc/stdio/findfp.c')
-rw-r--r--newlib/libc/stdio/findfp.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index c6790c491..a42a69206 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -151,20 +151,29 @@ __sinit (s)
s->__cleanup = _cleanup_r; /* conservative */
s->__sdidinit = 1;
- std (s->__sf + 0, __SRD, 0, s);
+ s->__sglue._next = NULL;
+#ifndef _REENT_SMALL
+ s->__sglue._niobs = 3;
+ s->__sglue._iobs = &s->__sf[0];
+#else
+ s->__sglue._niobs = 0;
+ s->__sglue._iobs = NULL;
+ s->_stdin = __sfp(s);
+ s->_stdout = __sfp(s);
+ s->_stderr = __sfp(s);
+#endif
+
+ std (s->_stdin, __SRD, 0, s);
/* on platforms that have true file system I/O, we can verify whether stdout
is an interactive terminal or not. For all other platforms, we will
default to line buffered mode here. */
#ifdef HAVE_FCNTL
- std (s->__sf + 1, __SWR, 1, s);
+ std (s->_stdout, __SWR, 1, s);
#else
- std (s->__sf + 1, __SWR | __SLBF, 1, s);
+ std (s->_stdout, __SWR | __SLBF, 1, s);
#endif
- std (s->__sf + 2, __SWR | __SNBF, 2, s);
+ std (s->_stderr, __SWR | __SNBF, 2, s);
- s->__sglue._next = NULL;
- s->__sglue._niobs = 3;
- s->__sglue._iobs = &s->__sf[0];
}