Changeset 1517
- Timestamp:
- Sep 19, 2004, 5:53:31 PM (21 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 5 added
- 2 deleted
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/Makefile
-
Property cvs2svn:cvs-rev
changed from
1.50
to1.51
r1516 r1517 91 91 92 92 # The C compiler 93 CC = gcc -c -Zmt -fmessage-length=0 93 CC = gcc -c -Zmt -fmessage-length=0 -DTIMEBOMB=1 94 94 # The C compiler flags 95 95 ifndef NO_LOCAL_HEADERS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/gnu/termcap/config.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1516 r1517 4 4 #include <string.h> 5 5 #include <io.h> 6 #include <gnu/termcap.h> 6 7 7 8 #define EMX 8 #define TERMCAP_FILE "/ emx/etc/termcap.dat"9 #define TERMCAP_FILE "/@unixroot/etc/termcap.dat" 9 10 #define HAVE_STRING_H 10 11 #define STDC_HEADERS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/gnu/termcap/termcap.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1516 r1517 122 122 static char *term_entry; 123 123 124 static char *tgetst1 (); 124 static char *tgetst1 (const char *ptr, char **area); 125 125 126 126 127 /* Search entry BP for capability CAP. … … 128 129 0 if not found. */ 129 130 130 static c har *131 static const char * 131 132 find_capability (bp, cap) 132 register c har *bp, *cap;133 register const char *bp, *cap; 133 134 { 134 135 for (; *bp; bp++) … … 142 143 int 143 144 tgetnum (cap) 144 c har *cap;145 { 146 register c har *ptr = find_capability (term_entry, cap);145 const char *cap; 146 { 147 register const char *ptr = find_capability (term_entry, cap); 147 148 if (!ptr || ptr[-1] != '#') 148 149 return -1; … … 152 153 int 153 154 tgetflag (cap) 154 c har *cap;155 { 156 register c har *ptr = find_capability (term_entry, cap);155 const char *cap; 156 { 157 register const char *ptr = find_capability (term_entry, cap); 157 158 return ptr && ptr[-1] == ':'; 158 159 } … … 165 166 char * 166 167 tgetstr (cap, area) 167 c har *cap;168 const char *cap; 168 169 char **area; 169 170 { 170 register c har *ptr = find_capability (term_entry, cap);171 register const char *ptr = find_capability (term_entry, cap); 171 172 if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) 172 173 return NULL; … … 193 194 static char * 194 195 tgetst1 (ptr, area) 195 c har *ptr;196 const char *ptr; 196 197 char **area; 197 198 { 198 register char *p, *r; 199 register const char *p; 200 register char *r; 199 201 register int c; 200 202 register int size; … … 286 288 void 287 289 tputs (str, nlines, outfun) 288 register c har *str;290 register const char *str; 289 291 int nlines; 290 292 register int (*outfun) (); … … 361 363 /* Forward declarations of static functions. */ 362 364 363 static int scan_file ( );364 static char *gobble_line ( );365 static int compare_contin ( );366 static int name_match ( );365 static int scan_file (char *str, int fd, struct buffer *bufp); 366 static char *gobble_line (int fd, struct buffer *bufp, char *append_end); 367 static int compare_contin (const char *str1, const char *str2); 368 static int name_match (char *line, char *name); 367 369 368 370 #ifdef EMX … … 426 428 int 427 429 tgetent (bp, name) 428 char *bp ,*name;430 char *bp; const char *name; 429 431 { 430 432 register char *termcap_name; … … 436 438 int malloc_size = 0; 437 439 register int c; 438 char *tcenv ;/* TERMCAP value, if it contains :tc=. */440 char *tcenv = NULL; /* TERMCAP value, if it contains :tc=. */ 439 441 char *indirect = NULL; /* Terminal type in :tc= in TERMCAP value. */ 440 442 int filep; … … 513 515 /* Add 1 to size to ensure room for terminating null. */ 514 516 buf.beg = (char *) xmalloc (buf.size + 1); 515 term = indirect ? indirect : name;517 term = indirect ? indirect : (char *)name; 516 518 517 519 if (!bp) … … 647 649 static int 648 650 compare_contin (str1, str2) 649 register c har *str1, *str2;651 register const char *str1, *str2; 650 652 { 651 653 register int c1, c2; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/gnu/termcap/tparam.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1516 r1517 19 19 #ifdef HAVE_CONFIG_H 20 20 #include <config.h> 21 #include <stdarg.h> 21 22 #else /* not HAVE_CONFIG_H */ 22 23 … … 85 86 The fourth and following args to tparam serve as the parameter values. */ 86 87 87 static char *tparam1 ( );88 static char *tparam1 (const char *string, char *outstring, int len, char *up, char *left, int *argp); 88 89 89 90 /* VARARGS 2 */ 90 91 char * 91 tparam (string, outstring, len, arg0, arg1, arg2, arg3) 92 char *string; 93 char *outstring; 94 int len; 95 int arg0, arg1, arg2, arg3; 96 { 97 int arg[4]; 98 99 arg[0] = arg0; 100 arg[1] = arg1; 101 arg[2] = arg2; 102 arg[3] = arg3; 103 return tparam1 (string, outstring, len, NULL, NULL, arg); 92 tparam (const char *string, char *outstring, int len, ...) 93 { 94 int args[4]; 95 va_list arg; 96 va_start (arg, len); 97 args[0] = va_arg (arg, int); 98 args[1] = va_arg (arg, int); 99 args[2] = va_arg (arg, int); 100 args[3] = va_arg (arg, int); 101 va_end (arg); 102 return tparam1 (string, outstring, len, NULL, NULL, args); 104 103 } 105 104 … … 111 110 char * 112 111 tgoto (cm, hpos, vpos) 113 c har *cm;112 const char *cm; 114 113 int hpos, vpos; 115 114 { … … 124 123 static char * 125 124 tparam1 (string, outstring, len, up, left, argp) 126 c har *string;125 const char *string; 127 126 char *outstring; 128 127 int len; … … 131 130 { 132 131 register int c; 133 register c har *p = string;132 register const char *p = string; 134 133 register char *op = outstring; 135 134 char *outend; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/InnoTekLIBC/backend.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1516 r1517 129 129 * @returns -1 and errno on failure. 130 130 * @param paStatFs Where to to store the statistics. 131 * @par macStatFS Number of structures the array pointed to by paStatFs can hold.131 * @param cStatFS Number of structures the array pointed to by paStatFs can hold. 132 132 * @param fFlags Flags, currently ignored. 133 133 */ … … 140 140 */ 141 141 void __libc_Back_fsSync(void); 142 143 /** 144 * Sets or change the unixroot of the current process. 145 * 146 * @returns 0 on success. 147 * @returns -1 and errno on failure. 148 * @param pszNewRoot The new root. 149 */ 150 int __libc_Back_fsChRoot(const char *pszNewRoot); 142 151 143 152 /** @} */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/error.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1516 r1517 2 2 /** @file 3 3 * GLIBC v2.3.2 4 * 5 * @changed bird: shut up -Wundef. 4 6 */ 5 7 … … 29 31 #ifndef __attribute__ 30 32 /* This feature is available in gcc versions 2.5 and later. */ 31 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__33 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (defined(__STRICT_ANSI__) && __STRICT_ANSI__) /* bird: shut up -Wundef */ 32 34 # define __attribute__(Spec) /* empty */ 33 35 # endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/os2thunk.h
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 16 16 void *_libc_16to32 (_far16ptr ptr); 17 17 18 typedef union _thunk_u 19 { 20 void *pv; 21 unsigned short *pus; 22 unsigned long *pul; 23 } _thunk_t; 24 18 25 unsigned long _libc_thunk1 (void *args, void *fun); 19 26 20 27 #define _THUNK_PASCAL_PROLOG(SIZE) \ 21 ({ char _tb[(SIZE)+4]; void *_tp= _tb + sizeof (_tb); \28 __extension__ ({ char _tb[(SIZE)+4]; _thunk_t _tu; _tu.pv = _tb + sizeof (_tb); \ 22 29 *(unsigned long *)_tb = (SIZE); 23 30 #define _THUNK_PASCAL_CHAR(ARG) _THUNK_PASCAL_SHORT (ARG) 24 #define _THUNK_PASCAL_SHORT(ARG) (*-- ((unsigned short *)_tp)= (ARG))25 #define _THUNK_PASCAL_LONG(ARG) (*-- ((unsigned long *)_tp)= (ARG))31 #define _THUNK_PASCAL_SHORT(ARG) (*--_tu.pus = (ARG)) 32 #define _THUNK_PASCAL_LONG(ARG) (*--_tu.pul = (ARG)) 26 33 #define _THUNK_PASCAL_FLAT(ARG) _THUNK_PASCAL_LONG (_libc_32to16 (ARG)) 27 34 #define _THUNK_PASCAL_FAR16(ARG) _THUNK_PASCAL_LONG (ARG) … … 31 38 32 39 #define _THUNK_C_PROLOG(SIZE) \ 33 ({ char _tb[(SIZE)+4]; void *_tp= _tb + sizeof (unsigned long); \40 __extension__ ({ char _tb[(SIZE)+4]; _thunk_t _tu; _tu.pv = _tb + sizeof (unsigned long); \ 34 41 *(unsigned long *)_tb = (SIZE); 35 42 #define _THUNK_C_CHAR(ARG) _THUNK_C_SHORT (ARG) 36 #define _THUNK_C_SHORT(ARG) (* ((unsigned short *)_tp)++ = (ARG))37 #define _THUNK_C_LONG(ARG) (* ((unsigned long *)_tp)++ = (ARG))43 #define _THUNK_C_SHORT(ARG) (*_tu.pus++ = (ARG)) 44 #define _THUNK_C_LONG(ARG) (*_tu.pul++ = (ARG)) 38 45 #define _THUNK_C_FLAT(ARG) _THUNK_C_LONG (_libc_32to16 (ARG)) 39 46 #define _THUNK_C_FAR16(ARG) _THUNK_C_LONG (ARG) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/string.h
-
Property cvs2svn:cvs-rev
changed from
1.13
to1.14
r1516 r1517 98 98 size_t strlen(const char *); 99 99 #if __BSD_VISIBLE 100 /** @todo void strmode(int, char *); */ 100 void strmode(int, char *); 101 101 #endif 102 102 char *strncat(char * __restrict, const char * __restrict, size_t); … … 116 116 char *strtok(char * __restrict, const char * __restrict); 117 117 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 118 /**@todo char *strtok_r(char *, const char *, char **); */ 118 char *strtok_r(char *, const char *, char **); 119 119 #endif 120 120 size_t strxfrm(char * __restrict, const char * __restrict, size_t); … … 138 138 char * strset(char *, int); 139 139 char * strupr(char *); 140 /* bird: Are we sure we actually want this stuff _here_ ? */141 extern char *__gnu_basename (const char *);142 #ifndef _LIBGEN_H143 #define basename __gnu_basename144 #endif145 140 #endif 146 141 … … 168 163 /* bird: GNU stuff - start */ 169 164 #ifdef __USE_GNU 165 char *basename(const char *); 170 166 size_t strnlen(const char *, size_t); 171 167 void *mempcpy(void *, const void *, size_t); 172 168 char *strndup(const char *, size_t); 173 169 void *memrchr(const void *, int, size_t); 170 #define memrchr(pach, ch, cch) _memrchr(pach, ch, cch) 171 int strverscmp(const char *, const char *); 174 172 175 173 size_t __strnlen(const char *, size_t); 176 174 void *__mempcpy(void *, const void *, size_t); 177 175 char *__strndup(const char *, size_t); 176 void *_memrchr(const void *, int, size_t); 178 177 void *__memrchr(const void *, int, size_t); 179 void *_memrchr(const void *, int, size_t); 180 181 #define memrchr(pach, ch, cch) _memrchr(pach, ch, cch) 182 #define __memrchr(pach, ch, cch) _memrchr(pach, ch, cch) 178 #define __memrchr(pach, ch, cch) _memrchr(pach, ch, cch) 179 int __strverscmp(const char *, const char *); 183 180 184 181 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/cdefs.h
-
Property cvs2svn:cvs-rev
changed from
1.8
to1.9
r1516 r1517 171 171 */ 172 172 #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) 173 #if __STDC_VERSION__ < 199901173 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 /* bird: check if not defined. (-pedantic) */ 174 174 #define __restrict 175 175 #else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/ioccom.h
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 83 83 */ 84 84 int TCPCALL os2_ioctl __P((int, int, char *, int)); 85 /** Wrapper around the ioctl() interface of OS/2 BSD 4.3. */ 86 int TCPCALL so_ioctl __P((int, unsigned long, ...)); 85 87 #else 86 /** The v41+ BSD socket ioctl interface. 87 * @remark sys based libc have separeate handle spaces for sockets and files 88 * therefore this socket specific call. 89 */ 88 /** The v41+ BSD socket ioctl interface. */ 90 89 int TCPCALL so_ioctl __P((int, unsigned long, ...)); 91 90 /** The v41+ OS/2 specific socket ioctl interface. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/unistd.h
-
Property cvs2svn:cvs-rev
changed from
1.18
to1.19
r1516 r1517 307 307 #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE 308 308 int brk(const void *); 309 /** @todo int chroot(const char *); */ 310 /** @todo int getdtablesize(void); */ 309 int chroot(const char *); 310 int getdtablesize(void); 311 311 int getpagesize(void) __pure2; 312 312 char *getpass(const char *); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emximp/emximp.c
-
Property cvs2svn:cvs-rev
changed from
1.11
to1.12
r1516 r1517 181 181 182 182 183 #if 0 /* not used */ 183 184 static void *xrealloc (void *p, size_t n) 184 185 { … … 190 191 return q; 191 192 } 193 #endif 192 194 193 195 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxaout.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 244 244 } 245 245 246 246 #if 0 /* not used */ 247 247 /* Display a warning message on stderr (and do not quit). This 248 248 function is invoked like printf(): FMT is a printf-style format … … 258 258 fputc ('\n', stderr); 259 259 } 260 260 #endif 261 261 262 262 /* Display some hints on using this program, then quit. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/listomf.c
-
Property cvs2svn:cvs-rev
changed from
1.12
to1.13
r1516 r1517 404 404 { 405 405 if (foff) 406 printf ("%*s%08lx %03 lx:", indent, "",406 printf ("%*s%08lx %03x:", indent, "", 407 407 rec_pos + rec_idx - 1 + sizeof (struct omf_rec), 408 408 rec_idx - 1 + sizeof (struct omf_rec)); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/stabshll.c
-
Property cvs2svn:cvs-rev
changed from
1.33
to1.34
r1516 r1517 1558 1558 * @returns NULL if not found. 1559 1559 * @param pszString String to search. 1560 * @param chType Type we're parsing. Use '\0' if unknown or it 1560 * @param chType Type we're parsing. Use '\0' if unknown or it 1561 1561 * should be ignored 1562 1562 * @remark Still a bad hack this. … … 1573 1573 #else 1574 1574 static const char *nextcolon2(const char *pszString, char chType) 1575 #endif 1575 #endif 1576 1576 { 1577 1577 const char *pszColon; … … 1624 1624 /* hack: continue on ">::" (but not on "operator...") */ 1625 1625 if ( chType != 'x' 1626 && psz[1] == ':' 1626 && psz[1] == ':' 1627 1627 && psz > pszString && psz[-1] == '>' 1628 ) 1628 ) 1629 1629 { 1630 1630 psz++; … … 3788 3788 if (name != NULL) 3789 3789 { 3790 int cch; 3791 if (type != SST_tag2 && (cch = strlen(name)) > 250) 3792 type = SST_tag2; 3793 3794 sst_start (type); 3795 buffer_word (&sst, index); 3796 if (type == SST_tag2) 3797 buffer_enc (&sst, name); 3790 size_t cch; 3791 if (type == SST_tag2 || (cch = strlen(name)) > 250) 3792 { 3793 sst_start (SST_tag2); 3794 buffer_word (&sst, index); 3795 buffer_enc (&sst, name); 3796 } 3798 3797 else 3799 3798 { … … 3802 3801 achName[cch] = '\0'; 3803 3802 3803 sst_start (type); 3804 buffer_word (&sst, index); 3804 3805 buffer_nstr (&sst, achName); 3805 3806 } 3806 3807 sst_end (); 3807 3808 } 3808 3809 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/weakld.c
-
Property cvs2svn:cvs-rev
changed from
1.28
to1.29
r1516 r1517 79 79 : symCompareTrucated(pWld, pSym, _pszName, _cchName) ) \ 80 80 ) 81 81 82 82 /** Compares a existing symbol with a potential symbol. */ 83 83 #define SYM_EQUAL2(pWld, pSym, _pszName, _fFlags, _uHash, _cchName, _pfn) \ … … 273 273 */ 274 274 WLDSF_WEAKALIASDONE = 0x8000, 275 275 276 276 /** Internal flag which indicates that the symbol have been 277 277 * truncated by emxomf. */ 278 278 WLDSF_TRUNCATED = 0x10000, 279 279 280 280 } fFlags; 281 281 … … 1259 1259 1260 1260 /** 1261 * Internal worker for SYM_EQUAL() 1261 * Internal worker for SYM_EQUAL() 1262 1262 * 1263 1263 * Compares truncated symbols. The hash for these symbols matches and at least … … 1671 1671 { 1672 1672 PWLDSYM pSym; /* The symbol. */ 1673 unsigned uHash ;/* The symbol name hash. */1673 unsigned uHash = 0; /* The symbol name hash. */ 1674 1674 const char *pszName; /* The symbol name in the string pool */ 1675 1675 int cchNameWeak = 0; /* Indicator and length of the weak name. (0 if not weak) */ … … 1697 1697 if ((fFlags & WLDSF_TYPEMASK) == WLDSF_WKEXT) 1698 1698 fFlags = (fFlags & ~WLDSF_TYPEMASK) | WLDSF_UNDEF; 1699 1699 1700 1700 if (cchName <= 200) 1701 1701 break; … … 1888 1888 } 1889 1889 } 1890 1890 1891 1891 /* 1892 1892 * Maintain list of truncated aliases. 1893 1893 */ 1894 if ( !SYM_IS_DEFINED(fFlags) 1894 if ( !SYM_IS_DEFINED(fFlags) 1895 1895 && ((fFlags & WLDSF_TRUNCATED) || (pSym->fFlags & WLDSF_TRUNCATED))) 1896 1896 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/include/libc-alias.h
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 35 35 #include "libc-std.h" 36 36 37 /* We don't need the basename -> __std_basename mapping, but we'll 38 get errors when including string.h... */ 39 #undef basename 37 #ifdef TIMEBOMB 38 asm(".stabs \"___libc_timebomb\",1,0,0,0"); 39 #endif 40 40 41 41 42 #endif /* __LIBC_ALIAS_H__ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/innidmdll/innidmdll.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 49 49 #endif 50 50 51 52 unsigned long _System InitDemangleID32(const char * psInitParms); 53 unsigned long _System DemangleID32(const char * psMangledName, char * pszPrototype, unsigned long cchPrototype); 51 54 52 55 … … 135 138 } 136 139 137 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/alias/alias.smak
-
Property cvs2svn:cvs-rev
changed from
1.24
to1.25
r1516 r1517 25 25 memrchr _memrchr \ 26 26 __memrchr _memrchr \ 27 strnlen __strnlen 27 strnlen __strnlen \ 28 __xpg_basename _std_basename 28 29 29 30 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/atod.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 409 409 if (neg) 410 410 mant |= 0x80000000ULL; 411 *p_result = *(float *) &mant;411 *p_result = *(float *)(void *)&mant; 412 412 break; 413 413 414 414 case 53: 415 415 /* Clear the integer bit. */ … … 419 419 if (neg) 420 420 mant |= 0x8000000000000000ULL; 421 *p_result = *(double *) &mant;421 *p_result = *(double *)(void *)&mant; 422 422 break; 423 423 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/dtoa.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 45 45 _BI_INIT (r); _BI_INIT (s); _BI_INIT (m); _BI_INIT (tmp); 46 46 47 bits = (const struct long_double_bits *) &x;47 bits = (const struct long_double_bits *)(void *)&x; 48 48 f = bits->mant; 49 49 e = bits->exp; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/smalatod.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 150 150 151 151 saved_errno = errno; errno = 0; 152 exp = strtol ((const char *)s, (char **) &q, 10);152 exp = strtol ((const char *)s, (char **)(void *)&q, 10); 153 153 if (errno == ERANGE) 154 154 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_newstre.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1516 r1517 7 7 #include <sys/fmutex.h> 8 8 #include <stdio.h> 9 #include <string.h> 9 10 #include <emx/io.h> 10 11 #include <emx/umalloc.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/lgpl/string/strverscmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1516 r1517 19 19 02111-1307 USA. */ 20 20 21 #include "libc-alias-glibc.h" 21 22 #include <string.h> 22 23 #include <ctype.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/libc.def
-
Property cvs2svn:cvs-rev
changed from
1.63
to1.64
r1516 r1517 238 238 "___get_page" @260 239 239 "___getcwd" @261 240 "__ _gnu_basename" @262240 "__std_chroot" @262 241 241 "___hash_open" @263 242 242 "___ibitmap" @264 … … 1177 1177 "___libc_OS2ErrorSet" @1197 1178 1178 "__getdcwd" @1198 1179 "___libc_Back_fsChRoot" @1202 1180 "__std_getdtablesize" @1203 1181 "_strmode" @1204 1182 "___strverscmp" @1205 1183 "___libc_timebomb" @1206 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/libc.smak
-
Property cvs2svn:cvs-rev
changed from
1.45
to1.46
r1516 r1517 104 104 $.omf/src/lib/sys/__init.obj 105 105 LIBC.OBJS := \ 106 $.omf/src/lib/startup/dll0hi fork.obj \106 $.omf/src/lib/startup/dll0hi.obj \ 107 107 $(LIBC.OBJS.COMMON) 108 108 LIBC.LIBS := $.omf/libc_s.lib $.omf/libc_app.lib … … 114 114 LIBC.PRF.DEF := $.omf/libc.prf.def 115 115 LIBC.PRF.OBJS := \ 116 $.omf/src/lib/startup/dll0hi fork.obj \116 $.omf/src/lib/startup/dll0hi.obj \ 117 117 $(subst /omf/,/omf-prof/,$(LIBC.OBJS.COMMON)) 118 118 LIBC.PRF.LIBS := $.omf-prof/libc_p_s.lib $.omf-prof/libc_app_p.lib … … 123 123 LIBC.ELH.DEF := $.omf/libc.elh.def 124 124 LIBC.ELH.OBJS := \ 125 $.omf/src/lib/startup/dll0hi fork.obj \125 $.omf/src/lib/startup/dll0hi.obj \ 126 126 $.omf/src/lib/startup/dllinit.obj 127 127 LIBC.ELH.LIBS := $(LIBC.LIBS) … … 132 132 LIBC.LOG.DEF := $(LIBC.DEF) 133 133 LIBC.LOG.OBJS := \ 134 $.omf/src/lib/startup/dll0hi fork.obj \134 $.omf/src/lib/startup/dll0hi.obj \ 135 135 $(subst /omf/,/omf-log/,$(LIBC.OBJS.COMMON)) 136 136 LIBC.LOG.LIBS := $.omf-log/libc_l_s.lib $.omf-log/libc_app_l.lib -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/wctomb.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1516 r1517 34 34 35 35 FS_SAVE_LOAD(); 36 rc = UniUconvFromUcs (__libc_GLocaleCtype.uobj, &ucs, &ni, (void **) &s, &no, &nonid);36 rc = UniUconvFromUcs (__libc_GLocaleCtype.uobj, &ucs, &ni, (void **)(void *)&s, &no, &nonid); 37 37 FS_RESTORE(); 38 38 if (rc) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/beginthr.c
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r1516 r1517 47 47 { 48 48 LIBCLOG_ENTER("pfnStart=%p pvStart=%p cbStack=%d pvArg=%p\n", pfnStart, pvStack, cbStack, pvArg); 49 APIRETrc;49 int rc; 50 50 TID tid; 51 51 __LIBC_PTHREAD pThrd; … … 80 80 * Set errno and cleanup. 81 81 */ 82 LIBC_ASSERTM_FAILED("DosCreateThread failed with rc=%u cbStack=%u\n", rc, (unsigned)cbStack);82 LIBC_ASSERTM_FAILED("DosCreateThread failed with rc=%u cbStack=%u\n", rc, cbStack); 83 83 if (rc == ERROR_NOT_ENOUGH_MEMORY) 84 84 errno = ENOMEM; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execvp.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 8 8 int _STD(execvp)(const char *name, char * const argv[]) 9 9 { 10 LIBCLOG_ENTER("name=% s argv=%s\n", name,argv);10 LIBCLOG_ENTER("name=%p:{%s} argv=%p\n", (void *)name, name, (void *)argv); 11 11 int rc = spawnvp(P_OVERLAY, name, argv); 12 12 LIBCLOG_RETURN_INT(rc); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/execvpe.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 8 8 int _STD(execvpe)(const char *name, char * const argv[], char * const envp[]) 9 9 { 10 LIBCLOG_ENTER("name=% s argv=%s envp=%s\n", name, argv,envp);10 LIBCLOG_ENTER("name=%p:{%s} argv=%p envp=%p\n", (void *)name, name, (void *)argv, (void *)envp); 11 11 int rc = spawnvpe(P_OVERLAY, name, argv, envp); 12 12 LIBCLOG_RETURN_INT(rc); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/386/crt0.s
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r1516 r1517 39 39 __text: 40 40 41 #if defined (FORK)41 #if !defined(NOFORK) && !defined(NOUNIX) 42 42 /* Registering the fork module. If we're forking this call will not return. */ 43 43 pushl $1 … … 90 90 .stabs "___eh_term__", 21, 0, 0, 0xffffffff 91 91 92 #if defined (FORK)92 #if !defined(NOFORK) && !defined(NOUNIX) 93 93 .stabs "___fork_parent1__", 21, 0, 0, 0xffffffff 94 94 .stabs "___fork_child1__", 21, 0, 0, 0xffffffff -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/386/dll0.s
-
Property cvs2svn:cvs-rev
changed from
1.11
to1.12
r1516 r1517 44 44 */ 45 45 do_common_init: 46 #if defined(FORK)46 #if !defined(NOFORK) && !defined(NOUNIX) 47 47 pushl $0 48 48 pushl $ForkModule … … 106 106 .stabs "___eh_init__", 21, 0, 0, 0xffffffff 107 107 .stabs "___eh_term__", 21, 0, 0, 0xffffffff 108 #if defined (FORK)108 #if !defined(NOFORK) && !defined(NOUNIX) 109 109 .stabs "___fork_parent1__", 21, 0, 0, 0xffffffff 110 110 .stabs "___fork_child1__", 21, 0, 0, 0xffffffff -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/startup.smak
-
Property cvs2svn:cvs-rev
changed from
1.14
to1.15
r1516 r1517 18 18 $(eval .OBJS += $.aout/src/lib/startup/crt0$(i).o) 19 19 $$.aout/src/lib/startup/crt0$(i).o: src/lib/startup/386/crt0.s 20 $$(call DO.COMPILE.s, $(subst noux, -DNOUNIX,$(subst fork, -DFORK,$(subst hi, -DHIGHMEM, $i))))20 $$(call DO.COMPILE.s, $(subst noux, -DNOUNIX,$(subst nofork, -DNOFORK,$(subst hi, -DHIGHMEM, $i)))) 21 21 22 22 $(eval .OBJS += $.aout/src/lib/startup/dll0$(i).o) 23 23 $$.aout/src/lib/startup/dll0$(i).o: src/lib/startup/386/dll0.s 24 $$(call DO.COMPILE.s, $(subst noux, -DNOUNIX,$(subst fork, -DFORK,$(subst hi, -DHIGHMEM, $i))))24 $$(call DO.COMPILE.s, $(subst noux, -DNOUNIX,$(subst nofork, -DNOFORK,$(subst hi, -DHIGHMEM, $i)))) 25 25 26 26 $(eval .OBJS += $.omf/src/lib/startup/crt0$(i).obj) … … 34 34 35 35 # generate 36 $(foreach i,hi hi fork hinoux hiforknoux forkforknoux noux,$(eval $(def_startup)))36 $(foreach i,hi hinofork hinoux hinoforknoux nofork noforknoux noux,$(eval $(def_startup))) 37 37 38 38 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/DosEx.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1516 r1517 43 43 #include <errno.h> 44 44 #include <stdlib.h> 45 #include <string.h> 45 46 #include <emx/startup.h> 46 47 #include <386/builtin.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__fcntl.c
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r1516 r1517 7 7 #include <limits.h> 8 8 #include <io.h> 9 #include <string.h> 9 10 #define INCL_ERRORS 10 11 #define INCL_FSMACROS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__read.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1516 r1517 70 70 * Non-standard filehandle. 71 71 */ 72 rc = pFH->pOps->pfnRead(pFH, handle, buf, cbToRead, &cbRead); 72 size_t cbRead2; 73 rc = pFH->pOps->pfnRead(pFH, handle, buf, cbToRead, &cbRead2); 74 cbRead = cbRead2; 73 75 } 74 76 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__utimes.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 16 16 17 17 18 static void _sys_t2p( longsec, PFTIME time, PFDATE date)18 static void _sys_t2p(time_t sec, PFTIME time, PFDATE date) 19 19 { 20 20 struct tm *p; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__write.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r1516 r1517 79 79 * Non-standard filehandle. 80 80 */ 81 rc = pFH->pOps->pfnWrite(pFH, handle, buf, cbToWrite, &cbWritten); 81 size_t cbWritten2; 82 rc = pFH->pOps->pfnWrite(pFH, handle, buf, cbToWrite, &cbWritten2); 83 cbWritten = cbWritten2; 82 84 } 83 85 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filehandles.c
-
Property cvs2svn:cvs-rev
changed from
1.12
to1.13
r1516 r1517 459 459 * @param pfh Where to store the opened fake handle. 460 460 */ 461 static int __libc_fhOpenDummy(int fh, int *pfh)461 static int fhOpenDummy(int fh, int *pfh) 462 462 { 463 463 int rc; … … 466 466 FS_VAR(); 467 467 468 /* 469 * Open the NUL device. 470 * If we're out of handle space, try increase it. 471 */ 468 472 FS_SAVE_LOAD(); 469 rc = DosOpen((PCSZ)"\\DEV\\NUL", &hFile, &ulAction, 0, FILE_NORMAL, 470 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, 471 OPEN_SHARE_DENYNONE | OPEN_ACCESS_WRITEONLY, 472 NULL); 473 for (;;) 474 { 475 rc = DosOpen((PCSZ)"\\DEV\\NUL", &hFile, &ulAction, 0, FILE_NORMAL, 476 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, 477 OPEN_SHARE_DENYNONE | OPEN_ACCESS_WRITEONLY, 478 NULL); 479 if (rc != ERROR_TOO_MANY_OPEN_FILES) 480 break; 481 rc = fhMoreHandles(0); 482 if (rc) 483 break; 484 } 473 485 if (!rc) 474 486 { 487 /* 488 * If the request was for a specific handle, we might have to dup it. 489 */ 475 490 if (fh != -1 && hFile != fh) 476 491 { … … 729 744 */ 730 745 LIBC_ASSERTM(pOps, "cannot open a non-standard handle without giving pOps!\n"); 731 rc = __libc_fhOpenDummy(-1, &fh);746 rc = fhOpenDummy(-1, &fh); 732 747 if (!rc) 733 748 { … … 760 775 { 761 776 /* 762 * Speci al handle.777 * Specific handle request. 763 778 * Make sure there are enough file handles available. 764 779 */ … … 772 787 * If not OS/2 filehandle, we have to make a fake handle. 773 788 */ 774 if (pOps) 775 rc = __libc_fhOpenDummy(-1, &fh);789 if (pOps) /** @todo check out the fh duplication with respect to close. */ 790 rc = fhOpenDummy(-1, &fh); 776 791 777 792 if (!rc) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/largefileio.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1516 r1517 74 74 * Get a handle to DOSCALLS/DOSCALL1 which is suitable for DosQueryProcAddr. 75 75 */ 76 if (DosLoadModule(NULL, 0, "DOSCALLS", &hmod))76 if (DosLoadModule(NULL, 0, (PCSZ)"DOSCALLS", &hmod)) 77 77 { 78 78 /* this is impossible! */ … … 83 83 } 84 84 85 if ( DosQueryProcAddr(hmod, ORD_DOS32OPENL, NULL, (PFN*) &__pfnDosOpenL)86 || DosQueryProcAddr(hmod, ORD_DOS32SETFILEPTRL, NULL, (PFN*) &__pfnDosSetFilePtrL)87 || DosQueryProcAddr(hmod, ORD_DOS32SETFILESIZEL, NULL, (PFN*) &__pfnDosSetFileSizeL)88 || DosQueryProcAddr(hmod, ORD_DOS32SETFILELOCKSL, NULL, (PFN*) &__pfnDosSetFileLocksL)85 if ( DosQueryProcAddr(hmod, ORD_DOS32OPENL, NULL, (PFN*)(void *)&__pfnDosOpenL) 86 || DosQueryProcAddr(hmod, ORD_DOS32SETFILEPTRL, NULL, (PFN*)(void *)&__pfnDosSetFilePtrL) 87 || DosQueryProcAddr(hmod, ORD_DOS32SETFILESIZEL, NULL, (PFN*)(void *)&__pfnDosSetFileSizeL) 88 || DosQueryProcAddr(hmod, ORD_DOS32SETFILELOCKSL, NULL, (PFN*)(void *)&__pfnDosSetFileLocksL) 89 89 ) 90 90 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/libcfork.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1516 r1517 36 36 #define INCL_EXAPIS 37 37 #define INCL_ERRORS 38 #define INCL_DOSINFOSEG 38 39 #include <os2emx.h> 39 40 #include <stdlib.h> … … 147 148 /*//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\*/ 148 149 150 #ifdef TIMEBOMB 151 static void forkTimebomb(void) 152 { 153 ULONG aul[2]; 154 FS_VAR(); 155 FS_SAVE_LOAD(); 156 /* this will trigger after the default one, so no message. */ 157 if ( !DosQuerySysInfo(QSV_TIME_LOW, QSV_TIME_HIGH, &aul, sizeof(aul)) 158 && aul[1] == 0 && aul[0] >= 0x414a47ad && aul[0] <= 0x41859c85) 159 { 160 FS_RESTORE(); 161 return; 162 } 163 for (;;) 164 DosExit(EXIT_PROCESS, 127); 165 } 166 #endif 167 149 168 150 169 /** … … 197 216 LIBCLOG_RETURN_INT(-1); 198 217 } 218 #ifdef TIMEBOMB 219 forkTimebomb(); 220 #endif 199 221 200 222 /* -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/logstrict.c
-
Property cvs2svn:cvs-rev
changed from
1.12
to1.13
r1516 r1517 1805 1805 ulValue = va_arg(args, signed long); 1806 1806 else if (chArgSize == 'h') 1807 ulValue = va_arg(args, signed short);1807 ulValue = va_arg(args, signed /*short*/ int); /* the great GCC pedantically saith use int. */ 1808 1808 else 1809 1809 ulValue = va_arg(args, signed int); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sharedpm.c
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r1516 r1517 59 59 #define INCL_FPCWMACROS 60 60 #define INCL_ERRORS 61 #define INCL_DOSINFOSEG 61 62 #include <os2emx.h> 62 63 #include <stdlib.h> … … 112 113 static int spmInit(void); 113 114 static VOID APIENTRY spmExitList(ULONG ulReason); 115 static void spmCleanup(void); 114 116 static void spmZombieOrFree(__LIBC_PSPMPROCESS pProcess); 115 117 static unsigned spmTimestamp(void); … … 136 138 137 139 /** 138 * Marks the current process (if we have it around) as zombie 139 * or dead freeing all resources associated with it. 140 * Sets the termination reason and exit code for the current process. 140 141 * 141 142 * @param uReason The OS/2 exit list type reason code. … … 148 149 { 149 150 LIBCLOG_ENTER("enmDeathReason=%d iExitCode=%d\n", enmDeathReason, iExitCode); 150 PPIB pPib;151 PTIB pTib;152 151 __LIBC_SPMXCPTREGREC RegRec; 153 int fFree = 0;154 152 FS_VAR(); 155 153 … … 161 159 162 160 /* 163 * Cleanup current process. 164 * Get pid before mutext as a speed and safety precaution. 161 * Set return code and reason. 165 162 */ 166 163 FS_SAVE_LOAD(); 167 DosGetInfoBlocks(&pTib, &pPib);168 164 if (!spmRequestMutex(&RegRec)) 169 165 { 170 /*171 * Free unborn children.172 */173 __LIBC_PSPMPROCESS pProcess = gpSPMHdr->apHeads[__LIBC_PROCSTATE_EMBRYO];174 pid_t pid = pPib->pib_ulpid;175 while (pProcess)176 {177 /* sanity */178 LIBC_ASSERTM(pProcess->enmState == __LIBC_PROCSTATE_EMBRYO, "Found non embryo process in embryo list! enmState=%d pid=%d\n",179 pProcess->enmState, pProcess->pid);180 LIBC_ASSERTM(pProcess->cReferences <= 1, "Invalid reference count of a process in the embryo list! cReferences=%d pid=%d\n",181 pProcess->cReferences, pProcess->pid);182 183 /* our child? */184 if (pProcess->pidParent == pid)185 {186 __LIBC_PSPMPROCESS pProcessNext = pProcess->pNext;187 188 /* Free it safely. */189 LIBCLOG_MSG("Cleanup embryo %p.\n", (void *)pProcess);190 spmZombieOrFree(pProcess);191 192 /* next */193 pProcess = pProcessNext;194 continue;195 }196 197 /* next */198 pProcess = pProcess->pNext;199 }200 201 166 /* 202 167 * Our selves. … … 204 169 if (gpSPMSelf) 205 170 { 206 /* */207 pProcess = gpSPMSelf;208 gpSPMSelf = NULL;209 210 171 /* update exit code and reason. */ 211 if (pProcess->iExitCode == 0) 212 pProcess->iExitCode = iExitCode; 213 if (pProcess->enmDeathReason == __LIBC_EXIT_REASON_NONE) 214 pProcess->enmDeathReason = enmDeathReason; 215 216 /* Determin whether to free shared stuff. */ 217 if (pProcess->cSPMOpens <= 1) 218 { 219 pProcess->cSPMOpens = 0; 220 fFree = 1; 221 } 222 else 223 pProcess->cSPMOpens--; 224 225 /* free our selves or become a zombie. */ 226 spmZombieOrFree(pProcess); 172 if (gpSPMSelf->iExitCode == 0) 173 gpSPMSelf->iExitCode = iExitCode; 174 if (gpSPMSelf->enmDeathReason == __LIBC_EXIT_REASON_NONE) 175 gpSPMSelf->enmDeathReason = enmDeathReason; 227 176 } 228 177 … … 233 182 } 234 183 235 #if 0 // @todo make this only when not terminating the process, it's a waste of time else wise. 236 /* 237 * Close the memory and semaphore. 238 * 239 * We don't close it unless we're sure not to mess up things 240 * for other users of the memory in this process. 241 */ 242 if (fFree) 243 { 244 DosCloseMutexSem(ghmtxSPM); 245 DosFreeMem(gpSPMHdr); 246 } 184 FS_RESTORE(); 185 LIBCLOG_RETURN_VOID(); 186 } 187 188 #ifdef TIMEBOMB 189 static void spmTimebomb(void) 190 { 191 PGINFOSEG pGIS = GETGINFOSEG(); 192 /* this will trigger after the default one, so no message. */ 193 if (pGIS->time >= 0x414a47ad && pGIS->time <= 0x41859c85) 194 return; 195 asm("lock; movl 0,%eax\n\t" 196 "int3\n\t" 197 "int3\n\t"); 198 } 247 199 #endif 248 200 249 FS_RESTORE();250 /* Mess up the state - reopen is not supported! */251 gpSPMHdr = NULL;252 gpSPMSelf = NULL;253 ghmtxSPM = 0;254 gcNesting = 42;255 LIBCLOG_RETURN_VOID();256 }257 201 258 202 /** … … 267 211 LIBCLOG_ENTER("\n"); 268 212 __LIBC_PSPMPROCESS pProcess; 213 214 #ifdef TIMEBOMB 215 spmTimebomb(); 216 #endif 269 217 270 218 /* … … 1299 1247 static VOID APIENTRY spmExitList(ULONG ulReason) 1300 1248 { 1249 /* 1250 * Check if the memory is accessible, if it ain't we'll crash or do other 1251 * nasty things is the code below. 1252 */ 1301 1253 if (ghmtxSPM) 1302 1254 { 1303 /*1304 * Convert reason.1305 */1306 __LIBC_EXIT_REASON enmDeathReason = __LIBC_EXIT_REASON_XCPT;1307 int iExitCode = -4; /* fixme!! */1308 switch (ulReason)1309 {1310 case TC_EXIT: enmDeathReason = __LIBC_EXIT_REASON_EXIT; iExitCode = 0; break;1311 case TC_HARDERROR: enmDeathReason = __LIBC_EXIT_REASON_HARDERROR; iExitCode = -1; break;1312 case TC_TRAP: enmDeathReason = __LIBC_EXIT_REASON_TRAP; iExitCode = -2; break;1313 case TC_KILLPROCESS:enmDeathReason = __LIBC_EXIT_REASON_KILL; iExitCode = -3; break;1314 case TC_EXCEPTION: enmDeathReason = __LIBC_EXIT_REASON_XCPT; iExitCode = -4; break;1315 }1316 1317 1255 /* 1318 1256 * Terminate tcpip. … … 1322 1260 if (gapfnSocketTerm[1]) 1323 1261 gapfnSocketTerm[1](); 1262 1263 /* 1264 * Convert reason. 1265 */ 1266 __LIBC_EXIT_REASON enmDeathReason = __LIBC_EXIT_REASON_XCPT; 1267 int iExitCode = -4; /* fixme!! */ 1268 switch (ulReason) 1269 { 1270 case TC_EXIT: enmDeathReason = __LIBC_EXIT_REASON_EXIT; iExitCode = 0; break; 1271 case TC_HARDERROR: enmDeathReason = __LIBC_EXIT_REASON_HARDERROR; iExitCode = -1; break; 1272 case TC_TRAP: enmDeathReason = __LIBC_EXIT_REASON_TRAP; iExitCode = -2; break; 1273 case TC_KILLPROCESS:enmDeathReason = __LIBC_EXIT_REASON_KILL; iExitCode = -3; break; 1274 case TC_EXCEPTION: enmDeathReason = __LIBC_EXIT_REASON_XCPT; iExitCode = -4; break; 1275 } 1324 1276 __libc_spmTerm(ulReason, iExitCode); 1277 1278 /* 1279 * Clean up the current process. 1280 */ 1281 spmCleanup(); 1325 1282 } 1326 1283 1327 1284 DosExitList(EXLST_EXIT, spmExitList); 1285 } 1286 1287 1288 /** 1289 * Marks the current process (if we have it around) as zombie 1290 * or dead freeing all resources associated with it. 1291 */ 1292 static void spmCleanup(void) 1293 { 1294 LIBCLOG_ENTER("\n"); 1295 PPIB pPib; 1296 PTIB pTib; 1297 __LIBC_SPMXCPTREGREC RegRec; 1298 int fFree = 0; 1299 FS_VAR(); 1300 1301 /* 1302 * Ignore request if already terminated. 1303 */ 1304 if (!gpSPMHdr || !ghmtxSPM) 1305 LIBCLOG_RETURN_VOID(); 1306 1307 /* 1308 * Cleanup current process. 1309 * Get pid before mutext as a speed and safety precaution. 1310 */ 1311 FS_SAVE_LOAD(); 1312 DosGetInfoBlocks(&pTib, &pPib); 1313 if (!spmRequestMutex(&RegRec)) 1314 { 1315 /* 1316 * Free unborn children. 1317 */ 1318 __LIBC_PSPMPROCESS pProcess = gpSPMHdr->apHeads[__LIBC_PROCSTATE_EMBRYO]; 1319 pid_t pid = pPib->pib_ulpid; 1320 while (pProcess) 1321 { 1322 /* sanity */ 1323 LIBC_ASSERTM(pProcess->enmState == __LIBC_PROCSTATE_EMBRYO, "Found non embryo process in embryo list! enmState=%d pid=%d\n", 1324 pProcess->enmState, pProcess->pid); 1325 LIBC_ASSERTM(pProcess->cReferences <= 1, "Invalid reference count of a process in the embryo list! cReferences=%d pid=%d\n", 1326 pProcess->cReferences, pProcess->pid); 1327 1328 /* our child? */ 1329 if (pProcess->pidParent == pid) 1330 { 1331 __LIBC_PSPMPROCESS pProcessNext = pProcess->pNext; 1332 1333 /* Free it safely. */ 1334 LIBCLOG_MSG("Cleanup embryo %p.\n", (void *)pProcess); 1335 spmZombieOrFree(pProcess); 1336 1337 /* next */ 1338 pProcess = pProcessNext; 1339 continue; 1340 } 1341 1342 /* next */ 1343 pProcess = pProcess->pNext; 1344 } 1345 1346 /* 1347 * Our selves. 1348 */ 1349 if (gpSPMSelf) 1350 { 1351 /* */ 1352 pProcess = gpSPMSelf; 1353 gpSPMSelf = NULL; 1354 1355 /* Determin whether to free shared stuff. */ 1356 if (pProcess->cSPMOpens <= 1) 1357 { 1358 pProcess->cSPMOpens = 0; 1359 fFree = 1; 1360 } 1361 else 1362 pProcess->cSPMOpens--; 1363 1364 /* free our selves or become a zombie. */ 1365 spmZombieOrFree(pProcess); 1366 } 1367 1368 /* 1369 * We're done, free the mutex. 1370 */ 1371 spmReleaseMutex(&RegRec); 1372 } 1373 1374 /* Mess up the state - reopen is not supported! */ 1375 gpSPMHdr = NULL; 1376 gpSPMSelf = NULL; 1377 ghmtxSPM = 0; 1378 gcNesting = 42; 1379 1380 FS_RESTORE(); 1381 LIBCLOG_RETURN_VOID(); 1328 1382 } 1329 1383 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/tcpipver.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1516 r1517 36 36 #include "libc-alias.h" 37 37 #include <errno.h> 38 #include <string.h> 38 39 #include <sys/socket.h> 39 40 #include <sys/sockio.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/usleep.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1516 r1517 106 106 if (ulOldPri < (PRTYC_TIMECRITICAL << 8)) 107 107 { 108 LIBCLOG_MSG("current priority %#05 x temporarily boosting priority\n", ulOldPri);108 LIBCLOG_MSG("current priority %#05lx temporarily boosting priority\n", ulOldPri); 109 109 DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); 110 110 } … … 117 117 if (msSleep >= 30 && msSleep < 33) 118 118 msSleep = 33; 119 LIBCLOG_MSG("DosSleep(% d)\n", msSleep);119 LIBCLOG_MSG("DosSleep(%ld)\n", msSleep); 120 120 DosSleep(msSleep); 121 121 122 122 if (ulOldPri < (PRTYC_TIMECRITICAL << 8)) 123 123 { 124 APIRETrc = DosSetPriority(PRTYS_THREAD, ulOldPri >> 8, ulOldPri & 0xff, 0);124 int rc = DosSetPriority(PRTYS_THREAD, ulOldPri >> 8, ulOldPri & 0xff, 0); 125 125 if (rc) 126 126 { 127 LIBCLOG_MSG("DosSetPriority(,% x,%x,0) failed with rc=%d\n",127 LIBCLOG_MSG("DosSetPriority(,%lx,%lx,0) failed with rc=%d\n", 128 128 ulOldPri >> 8, ulOldPri & 0xff, rc); 129 129 //@todo add assertion. … … 137 137 * Simple DosSleep(). 138 138 */ 139 LIBCLOG_MSG("DosSleep(% d)\n", msSleep);139 LIBCLOG_MSG("DosSleep(%ld)\n", msSleep); 140 140 DosSleep(msSleep); 141 141 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libsocket/getpeername.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 39 39 int getpeername(int socket, struct sockaddr *addr, int *addrlen) 40 40 { 41 LIBCLOG_ENTER("socket=%d addr=%p addrlen=% d\n", socket, addr,addrlen);41 LIBCLOG_ENTER("socket=%d addr=%p addrlen=%p\n", socket, (void *)addr, (void *)addrlen); 42 42 PLIBCSOCKETFH pFHSocket = __libc_TcpipFH(socket); 43 43 if (pFHSocket) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libsocket/getsockname.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1516 r1517 39 39 int getsockname(int socket, struct sockaddr *addr, int *addrlen) 40 40 { 41 LIBCLOG_ENTER("socket=%d addr=%p addrlen=% d\n", socket, addr,addrlen);41 LIBCLOG_ENTER("socket=%d addr=%p addrlen=%p\n", socket, (void *)addr, (void *)addrlen); 42 42 PLIBCSOCKETFH pFHSocket = __libc_TcpipFH(socket); 43 43 if (pFHSocket) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libsocket/getsockopt.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 39 39 int getsockopt(int socket, int level, int optname, void *optval, int *optlen) 40 40 { 41 LIBCLOG_ENTER("socket=%d level=%#x optname=%#x optval=%p optlen=% d\n",42 socket, level, optname, optval,optlen);41 LIBCLOG_ENTER("socket=%d level=%#x optname=%#x optval=%p optlen=%p\n", 42 socket, level, optname, (void *)optval, (void *)optlen); 43 43 PLIBCSOCKETFH pFHSocket = __libc_TcpipFH(socket); 44 44 if (pFHSocket) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libsocket/recvfrom.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 39 39 int recvfrom(int socket, void *buf, int len, int flags, struct sockaddr *from, int *fromlen) 40 40 { 41 LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x from=%p from=% d\n",42 socket, buf, len, flags, from,fromlen);41 LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x from=%p from=%p\n", 42 socket, buf, len, flags, (void *)from, (void *)fromlen); 43 43 PLIBCSOCKETFH pFHSocket = __libc_TcpipFH(socket); 44 44 if (pFHSocket) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libsocket/sendto.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1516 r1517 39 39 int sendto(int socket, const void *buf, int len, int flags, const struct sockaddr *to, int tolen) 40 40 { 41 LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x to=%p tolen=% p\n",42 socket, buf, len, flags, to, tolen);41 LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x to=%p tolen=%d\n", 42 socket, buf, len, flags, (void *)to, tolen); 43 43 PLIBCSOCKETFH pFHSocket = __libc_TcpipFH(socket); 44 44 if (pFHSocket) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.