diff packages/io/fileio/current/src/file.cxx @ 134:d2f49caf9e38 ecos-sw-2000-11-03

Merge from eCos master repository on 2000-11-03-09:00:49-GMT
author jlarmour
date Fri, 03 Nov 2000 21:17:40 +0000
parents 0c2b7be0d798
children b939e9cada46
line wrap: on
line diff
--- a/packages/io/fileio/current/src/file.cxx
+++ b/packages/io/fileio/current/src/file.cxx
@@ -47,6 +47,7 @@
 #include <pkgconf/hal.h>
 #include <pkgconf/kernel.h>
 #include <pkgconf/io_fileio.h>
+#include <pkgconf/isoinfra.h>
 
 #include <cyg/kernel/ktypes.h>         // base kernel types
 #include <cyg/infra/cyg_trac.h>        // tracing macros
@@ -54,6 +55,7 @@
 
 #include <string.h>                    // string functions
 #include <dirent.h>
+#include <stdio.h>                     // stdin, stdout, stderr
 
 #include "fio.h"                       // Private header
 
@@ -168,6 +170,14 @@ static Cyg_Mutex getcwd_lock CYGBLD_ATTR
 {
     FILEIO_ENTRY();
 
+    // we want to be sure we pull in stdin/out/err, so they can be
+    // assigned to fds 0, 1 and 2
+#ifdef CYGINT_ISO_STDIO_STREAMS
+    CYG_REFERENCE_OBJECT(stdin);
+    CYG_REFERENCE_OBJECT(stdout);
+    CYG_REFERENCE_OBJECT(stderr);
+#endif
+
     CYG_CANCELLATION_POINT;
 
     int ret = 0;