Changeset 2548
- Timestamp:
- Mar 2, 2006, 2:26:41 AM (19 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/ChangeLog.LIBC
r2545 r2548 2 2 3 3 TODO: open replace on RAMFS fails with error 32! 4 5 2006-03-01: knut st. osmundsen <bird-gccos2-spam@anduin.net> 6 - libc: 7 o #58: The standard file handles are always initialized as open. 4 8 5 9 2006-02-06: knut st. osmundsen <bird-gccos2-spam@anduin.net> -
branches/libc-0.6/src/emx/src/lib/app/stdio.c
r2120 r2548 92 92 { 93 93 PLIBCFH pFH = __libc_FH(i); 94 if (pFH) 94 if (!pFH) 95 LIBCLOG_MSG("No open file for %d\n", i); 96 97 /* 98 * Common init - recall everything is ZERO. 99 */ 100 gPreStreamVec.cFree--; 101 gaPreFiles[i].__uVersion = _FILE_STDIO_VERSION; 102 gaPreFiles[i]._flags |= _IOOPEN | _IONOCLOSEALL; 103 gaPreFiles[i]._handle = i; 104 gaPreFiles[i]._flush = _flushstream; 105 if (_fmutex_create2(&gaPreFiles[i].__u.__fsem, 0, "LIBC stream") != 0) 95 106 { 96 /* 97 * Common init - recall everything is ZERO. 98 */ 99 gPreStreamVec.cFree--; 100 gaPreFiles[i].__uVersion = _FILE_STDIO_VERSION; 101 gaPreFiles[i]._flags |= _IOOPEN | _IONOCLOSEALL; 102 gaPreFiles[i]._handle = i; 103 gaPreFiles[i]._flush = _flushstream; 104 if (_fmutex_create2(&gaPreFiles[i].__u.__fsem, 0, "LIBC stream") != 0) 105 { 106 LIBC_ASSERTM_FAILED("_setmore failed for i=%d\n", i); 107 abort(); 108 } 107 LIBC_ASSERTM_FAILED("_setmore failed for i=%d\n", i); 108 abort(); 109 } 109 110 110 111 112 113 114 115 116 117 118 119 120 121 122 111 /* 112 * Specific init. 113 */ 114 switch (i) 115 { 116 case 0: 117 /* stdin is always buffered. */ 118 gaPreFiles[0]._flags |= _IOREAD | _IOFBF | _IOBUFUSER; 119 gaPreFiles[0]._ptr = gachStdIn; 120 gaPreFiles[0]._buffer = gachStdIn; 121 gaPreFiles[0]._buf_size = BUFSIZ; 122 LIBCLOG_MSG("__stdinp=%p\n", (void *)__stdinp); 123 break; 123 124 124 125 126 127 | ((pFH->fFlags & __LIBC_FH_TYPEMASK) == F_DEV ? _IONBF : _IOFBF);128 129 130 125 case 1: 126 /* stdout is buffered unless it's connected to a device. */ 127 gaPreFiles[1]._flags |= _IOWRT | _IOBUFNONE 128 | (pFH && (pFH->fFlags & __LIBC_FH_TYPEMASK) == F_DEV ? _IONBF : _IOFBF); 129 LIBCLOG_MSG("__stdoutp=%p flags=%#x (%s)\n", (void *)__stdoutp, gaPreFiles[1]._flags, 130 pFH && (pFH->fFlags & __LIBC_FH_TYPEMASK) == F_DEV ? "dev" : "none-dev"); 131 break; 131 132 132 case 2: 133 /* stderr is always unbuffered. */ 134 gaPreFiles[2]._flags |= _IOWRT | _IOBUFNONE | _IONBF; 135 LIBCLOG_MSG("__stderrp=%p\n", (void *)__stderrp); 136 break; 137 } 133 case 2: 134 /* stderr is always unbuffered. */ 135 gaPreFiles[2]._flags |= _IOWRT | _IOBUFNONE | _IONBF; 136 LIBCLOG_MSG("__stderrp=%p\n", (void *)__stderrp); 137 break; 138 138 } 139 else140 LIBCLOG_MSG("No open file for %d\n", i);141 139 } /* for standard handles. */ 142 140 LIBCLOG_RETURN_VOID();
Note:
See TracChangeset
for help on using the changeset viewer.