Changeset 1080
- Timestamp:
- Jan 25, 2004, 11:33:36 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/startup/startup.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1079 r1080 10 10 #include <emx/startup.h> 11 11 12 #if 0 /* dead */13 /* See app/iodata.c. */14 15 extern int _nfiles;16 extern int _files[];17 extern int _lookahead[];18 #endif19 20 12 extern int __crtinit1__; 21 13 extern void __ctordtorInit1 (int *ptr); 22 23 static void init_files (void);24 14 25 15 … … 36 26 startup_flag = 1; 37 27 38 #if 0 /* moved to __init_dll() */39 /* Initialize the file handles. */40 init_files ();41 #endif42 43 28 /* Initialize streams etc. if required. */ 44 29 __ctordtorInit1 (&__crtinit1__); … … 54 39 } 55 40 56 57 #if 0 /* moved to __init_dll() */58 /* Initialize the file handles. */59 60 static void init_files (void)61 {62 int i, ht, fl;63 64 for (i = 0; i < _nfiles; ++i)65 {66 _files[i] = 0;67 _lookahead[i] = -1;68 69 /* Get the handle type. If this fails, the handle is not open. */70 71 if (i < _io_ninherit && __ioctl2 (i, FGETHTYPE, (int)&ht) == 0)72 {73 /* init_streams() depends on _files[] being non-zero for74 open file handles. When omitting O_TEXT, don't forget to75 set another bit. */76 77 _files[i] |= O_TEXT;78 if (HT_ISDEV (ht))79 _files[i] |= F_DEV;80 if (ht == HT_UPIPE || ht == HT_NPIPE)81 {82 _files[i] |= F_PIPE;83 fl = __fcntl (i, F_GETFL, 0);84 if (fl >= 0)85 _files[i] |= fl & O_NDELAY;86 }87 switch (i)88 {89 case 0:90 _files[0] |= O_RDONLY;91 break;92 93 case 1:94 case 2:95 _files[i] |= O_WRONLY;96 break;97 98 default:99 /* All other handles can be read and written. */100 _files[i] |= O_RDWR;101 break;102 }103 }104 }105 }106 #endif107 41 108 42 … … 173 107 * - exit() will call all the registered at_exit functions. 174 108 * - exit() will call DosExit with the exit code and terminate the process. 109 * 110 * @todo update this with file handle changes! 175 111 */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.