Changeset 1517


Ignore:
Timestamp:
Sep 19, 2004, 5:53:31 PM (21 years ago)
Author:
bird
Message:

Fixing warnings. -Znofork

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 to 1.51
    r1516 r1517  
    9191
    9292# The C compiler
    93 CC = gcc -c -Zmt -fmessage-length=0
     93CC = gcc -c -Zmt -fmessage-length=0 -DTIMEBOMB=1
    9494# The C compiler flags
    9595ifndef NO_LOCAL_HEADERS
  • trunk/src/emx/gnu/termcap/config.h

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1516 r1517  
    44#include <string.h>
    55#include <io.h>
     6#include <gnu/termcap.h>
    67
    78#define EMX
    8 #define TERMCAP_FILE    "/emx/etc/termcap.dat"
     9#define TERMCAP_FILE    "/@unixroot/etc/termcap.dat"
    910#define HAVE_STRING_H
    1011#define STDC_HEADERS
  • trunk/src/emx/gnu/termcap/termcap.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1516 r1517  
    122122static char *term_entry;
    123123
    124 static char *tgetst1 ();
     124static char *tgetst1 (const char *ptr, char **area);
     125
    125126
    126127/* Search entry BP for capability CAP.
     
    128129   0 if not found.  */
    129130
    130 static char *
     131static const char *
    131132find_capability (bp, cap)
    132      register char *bp, *cap;
     133     register const char *bp, *cap;
    133134{
    134135  for (; *bp; bp++)
     
    142143int
    143144tgetnum (cap)
    144      char *cap;
    145 {
    146   register char *ptr = find_capability (term_entry, cap);
     145     const char *cap;
     146{
     147  register const char *ptr = find_capability (term_entry, cap);
    147148  if (!ptr || ptr[-1] != '#')
    148149    return -1;
     
    152153int
    153154tgetflag (cap)
    154      char *cap;
    155 {
    156   register char *ptr = find_capability (term_entry, cap);
     155     const char *cap;
     156{
     157  register const char *ptr = find_capability (term_entry, cap);
    157158  return ptr && ptr[-1] == ':';
    158159}
     
    165166char *
    166167tgetstr (cap, area)
    167      char *cap;
     168     const char *cap;
    168169     char **area;
    169170{
    170   register char *ptr = find_capability (term_entry, cap);
     171  register const char *ptr = find_capability (term_entry, cap);
    171172  if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
    172173    return NULL;
     
    193194static char *
    194195tgetst1 (ptr, area)
    195      char *ptr;
     196     const char *ptr;
    196197     char **area;
    197198{
    198   register char *p, *r;
     199  register const char *p;
     200  register char *r;
    199201  register int c;
    200202  register int size;
     
    286288void
    287289tputs (str, nlines, outfun)
    288      register char *str;
     290     register const char *str;
    289291     int nlines;
    290292     register int (*outfun) ();
     
    361363/* Forward declarations of static functions.  */
    362364
    363 static int scan_file ();
    364 static char *gobble_line ();
    365 static int compare_contin ();
    366 static int name_match ();
     365static int scan_file (char *str, int fd, struct buffer *bufp);
     366static char *gobble_line (int fd, struct buffer *bufp, char *append_end);
     367static int compare_contin (const char *str1, const char *str2);
     368static int name_match (char *line, char *name);
    367369
    368370#ifdef EMX
     
    426428int
    427429tgetent (bp, name)
    428      char *bp, *name;
     430     char *bp; const char *name;
    429431{
    430432  register char *termcap_name;
     
    436438  int malloc_size = 0;
    437439  register int c;
    438   char *tcenv                /* TERMCAP value, if it contains :tc=.  */
     440  char *tcenv = NULL;           /* TERMCAP value, if it contains :tc=.  */
    439441  char *indirect = NULL;        /* Terminal type in :tc= in TERMCAP value.  */
    440442  int filep;
     
    513515  /* Add 1 to size to ensure room for terminating null.  */
    514516  buf.beg = (char *) xmalloc (buf.size + 1);
    515   term = indirect ? indirect : name;
     517  term = indirect ? indirect : (char *)name;
    516518
    517519  if (!bp)
     
    647649static int
    648650compare_contin (str1, str2)
    649      register char *str1, *str2;
     651     register const char *str1, *str2;
    650652{
    651653  register int c1, c2;
  • trunk/src/emx/gnu/termcap/tparam.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1516 r1517  
    1919#ifdef HAVE_CONFIG_H
    2020#include <config.h>
     21#include <stdarg.h>
    2122#else /* not HAVE_CONFIG_H */
    2223
     
    8586   The fourth and following args to tparam serve as the parameter values.  */
    8687
    87 static char *tparam1 ();
     88static char *tparam1 (const char *string, char *outstring, int len, char *up, char *left, int *argp);
    8889
    8990/* VARARGS 2 */
    9091char *
    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);
     92tparam (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);
    104103}
    105104
     
    111110char *
    112111tgoto (cm, hpos, vpos)
    113      char *cm;
     112     const char *cm;
    114113     int hpos, vpos;
    115114{
     
    124123static char *
    125124tparam1 (string, outstring, len, up, left, argp)
    126      char *string;
     125     const char *string;
    127126     char *outstring;
    128127     int len;
     
    131130{
    132131  register int c;
    133   register char *p = string;
     132  register const char *p = string;
    134133  register char *op = outstring;
    135134  char *outend;
  • trunk/src/emx/include/InnoTekLIBC/backend.h

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1516 r1517  
    129129 * @returns -1 and errno on failure.
    130130 * @param   paStatFs    Where to to store the statistics.
    131  * @parma   cStatFS     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.
    132132 * @param   fFlags      Flags, currently ignored.
    133133 */
     
    140140 */
    141141void __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 */
     150int __libc_Back_fsChRoot(const char *pszNewRoot);
    142151
    143152/** @} */
  • trunk/src/emx/include/error.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1516 r1517  
    22/** @file
    33 * GLIBC v2.3.2
     4 *
     5 * @changed bird: shut up -Wundef.
    46 */
    57
     
    2931#ifndef __attribute__
    3032/* 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 */
    3234#  define __attribute__(Spec) /* empty */
    3335# endif
  • trunk/src/emx/include/os2thunk.h

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    1616void *_libc_16to32 (_far16ptr ptr);
    1717
     18typedef union _thunk_u
     19{
     20    void *pv;
     21    unsigned short *pus;
     22    unsigned long *pul;
     23} _thunk_t;
     24
    1825unsigned long _libc_thunk1 (void *args, void *fun);
    1926
    2027#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); \
    2229       *(unsigned long *)_tb = (SIZE);
    2330#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))
    2633#define _THUNK_PASCAL_FLAT(ARG)     _THUNK_PASCAL_LONG (_libc_32to16 (ARG))
    2734#define _THUNK_PASCAL_FAR16(ARG)    _THUNK_PASCAL_LONG (ARG)
     
    3138
    3239#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); \
    3441       *(unsigned long *)_tb = (SIZE);
    3542#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))
    3845#define _THUNK_C_FLAT(ARG)     _THUNK_C_LONG (_libc_32to16 (ARG))
    3946#define _THUNK_C_FAR16(ARG)    _THUNK_C_LONG (ARG)
  • trunk/src/emx/include/string.h

    • Property cvs2svn:cvs-rev changed from 1.13 to 1.14
    r1516 r1517  
    9898size_t   strlen(const char *);
    9999#if __BSD_VISIBLE
    100 /** @todo void   strmode(int, char *); */
     100void     strmode(int, char *);
    101101#endif
    102102char    *strncat(char * __restrict, const char * __restrict, size_t);
     
    116116char    *strtok(char * __restrict, const char * __restrict);
    117117#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
    118 /**@todo char   *strtok_r(char *, const char *, char **); */
     118char    *strtok_r(char *, const char *, char **);
    119119#endif
    120120size_t   strxfrm(char * __restrict, const char * __restrict, size_t);
     
    138138char *  strset(char *, int);
    139139char *  strupr(char *);
    140 /* bird: Are we sure we actually want this stuff _here_ ? */
    141 extern char *__gnu_basename (const char *);
    142 #ifndef _LIBGEN_H
    143 #define basename __gnu_basename
    144 #endif
    145140#endif
    146141
     
    168163/* bird: GNU stuff - start */
    169164#ifdef __USE_GNU
     165char    *basename(const char *);
    170166size_t   strnlen(const char *, size_t);
    171167void    *mempcpy(void *, const void *, size_t);
    172168char    *strndup(const char *, size_t);
    173169void    *memrchr(const void *, int, size_t);
     170#define  memrchr(pach, ch, cch)     _memrchr(pach, ch, cch)
     171int      strverscmp(const char *, const char *);
    174172
    175173size_t   __strnlen(const char *, size_t);
    176174void    *__mempcpy(void *, const void *, size_t);
    177175char    *__strndup(const char *, size_t);
     176void    *_memrchr(const void *, int, size_t);
    178177void    *__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)
     179int      __strverscmp(const char *, const char *);
    183180
    184181#endif
  • trunk/src/emx/include/sys/cdefs.h

    • Property cvs2svn:cvs-rev changed from 1.8 to 1.9
    r1516 r1517  
    171171 */
    172172#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
    173 #if __STDC_VERSION__ < 199901
     173#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 /* bird: check if not defined. (-pedantic) */
    174174#define __restrict
    175175#else
  • trunk/src/emx/include/sys/ioccom.h

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    8383 */
    8484int         TCPCALL os2_ioctl __P((int, int, char *, int));
     85/** Wrapper around the ioctl() interface of OS/2 BSD 4.3. */
     86int         TCPCALL so_ioctl __P((int, unsigned long, ...));
    8587#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. */
    9089int         TCPCALL so_ioctl __P((int, unsigned long, ...));
    9190/** The v41+ OS/2 specific socket ioctl interface. */
  • trunk/src/emx/include/unistd.h

    • Property cvs2svn:cvs-rev changed from 1.18 to 1.19
    r1516 r1517  
    307307#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
    308308int      brk(const void *);
    309 /** @todo int    chroot(const char *); */
    310 /** @todo int    getdtablesize(void); */
     309int      chroot(const char *);
     310int      getdtablesize(void);
    311311int      getpagesize(void) __pure2;
    312312char    *getpass(const char *);
  • trunk/src/emx/src/emximp/emximp.c

    • Property cvs2svn:cvs-rev changed from 1.11 to 1.12
    r1516 r1517  
    181181
    182182
     183#if 0 /* not used */
    183184static void *xrealloc (void *p, size_t n)
    184185{
     
    190191  return q;
    191192}
     193#endif
    192194
    193195
  • trunk/src/emx/src/emxomf/emxaout.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    244244}
    245245
    246 
     246#if 0 /* not used */
    247247/* Display a warning message on stderr (and do not quit).  This
    248248   function is invoked like printf(): FMT is a printf-style format
     
    258258  fputc ('\n', stderr);
    259259}
    260 
     260#endif
    261261
    262262/* Display some hints on using this program, then quit. */
  • trunk/src/emx/src/emxomf/listomf.c

    • Property cvs2svn:cvs-rev changed from 1.12 to 1.13
    r1516 r1517  
    404404        {
    405405          if (foff)
    406             printf ("%*s%08lx %03lx:", indent, "",
     406            printf ("%*s%08lx %03x:", indent, "",
    407407                    rec_pos + rec_idx - 1 + sizeof (struct omf_rec),
    408408                    rec_idx - 1 + sizeof (struct omf_rec));
  • trunk/src/emx/src/emxomf/stabshll.c

    • Property cvs2svn:cvs-rev changed from 1.33 to 1.34
    r1516 r1517  
    15581558 * @returns NULL if not found.
    15591559 * @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
    15611561 *                      should be ignored
    15621562 * @remark  Still a bad hack this.
     
    15731573#else
    15741574static const char *nextcolon2(const char *pszString, char chType)
    1575 #endif 
     1575#endif
    15761576{
    15771577    const char *pszColon;
     
    16241624                    /* hack: continue on ">::" (but not on "operator...") */
    16251625                    if (    chType != 'x'
    1626                         &&  psz[1] == ':' 
     1626                        &&  psz[1] == ':'
    16271627                        &&  psz > pszString && psz[-1] == '>'
    1628                             ) 
     1628                            )
    16291629                    {
    16301630                        psz++;
     
    37883788  if (name != NULL)
    37893789    {
    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        }
    37983797      else
    37993798        {
     
    38023801          achName[cch] = '\0';
    38033802
     3803          sst_start (type);
     3804          buffer_word (&sst, index);
    38043805          buffer_nstr (&sst, achName);
    38053806        }
    3806         sst_end ();
     3807      sst_end ();
    38073808    }
    38083809}
  • trunk/src/emx/src/emxomf/weakld.c

    • Property cvs2svn:cvs-rev changed from 1.28 to 1.29
    r1516 r1517  
    7979         : symCompareTrucated(pWld, pSym, _pszName, _cchName) )                     \
    8080      )
    81      
     81
    8282/** Compares a existing symbol with a potential symbol. */
    8383#define SYM_EQUAL2(pWld, pSym, _pszName, _fFlags, _uHash, _cchName, _pfn) \
     
    273273         */
    274274        WLDSF_WEAKALIASDONE = 0x8000,
    275        
     275
    276276        /** Internal flag which indicates that the symbol have been
    277277         * truncated by emxomf. */
    278278        WLDSF_TRUNCATED = 0x10000,
    279          
     279
    280280    }                   fFlags;
    281281
     
    12591259
    12601260/**
    1261  * Internal worker for SYM_EQUAL() 
     1261 * Internal worker for SYM_EQUAL()
    12621262 *
    12631263 * Compares truncated symbols. The hash for these symbols matches and at least
     
    16711671{
    16721672    PWLDSYM     pSym;                   /* The symbol. */
    1673     unsigned    uHash;                  /* The symbol name hash. */
     1673    unsigned    uHash = 0;              /* The symbol name hash. */
    16741674    const char *pszName;                /* The symbol name in the string pool */
    16751675    int         cchNameWeak = 0;        /* Indicator and length of the weak name. (0 if not weak) */
     
    16971697            if ((fFlags & WLDSF_TYPEMASK) == WLDSF_WKEXT)
    16981698                fFlags = (fFlags & ~WLDSF_TYPEMASK) | WLDSF_UNDEF;
    1699            
     1699
    17001700            if (cchName <= 200)
    17011701                break;
     
    18881888            }
    18891889        }
    1890        
     1890
    18911891        /*
    18921892         * Maintain list of truncated aliases.
    18931893         */
    1894         if (    !SYM_IS_DEFINED(fFlags) 
     1894        if (    !SYM_IS_DEFINED(fFlags)
    18951895            && ((fFlags & WLDSF_TRUNCATED) || (pSym->fFlags & WLDSF_TRUNCATED)))
    18961896        {
  • trunk/src/emx/src/include/libc-alias.h

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    3535#include "libc-std.h"
    3636
    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
     38asm(".stabs  \"___libc_timebomb\",1,0,0,0");
     39#endif
     40
    4041
    4142#endif /* __LIBC_ALIAS_H__ */
  • trunk/src/emx/src/innidmdll/innidmdll.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    4949#endif
    5050
     51
     52unsigned long _System InitDemangleID32(const char * psInitParms);
     53unsigned long _System DemangleID32(const char * psMangledName, char * pszPrototype, unsigned long cchPrototype);
    5154
    5255
     
    135138}
    136139
    137 
  • trunk/src/emx/src/lib/alias/alias.smak

    • Property cvs2svn:cvs-rev changed from 1.24 to 1.25
    r1516 r1517  
    2525        memrchr                 _memrchr \
    2626        __memrchr               _memrchr \
    27         strnlen                 __strnlen
     27        strnlen                 __strnlen \
     28        __xpg_basename  _std_basename
    2829
    2930
  • trunk/src/emx/src/lib/conv/atod.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    409409      if (neg)
    410410        mant |= 0x80000000ULL;
    411       *p_result = *(float *)&mant;
     411      *p_result = *(float *)(void *)&mant;
    412412      break;
    413      
     413
    414414    case 53:
    415415      /* Clear the integer bit. */
     
    419419      if (neg)
    420420        mant |= 0x8000000000000000ULL;
    421       *p_result = *(double *)&mant;
     421      *p_result = *(double *)(void *)&mant;
    422422      break;
    423423
  • trunk/src/emx/src/lib/conv/dtoa.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    4545  _BI_INIT (r); _BI_INIT (s); _BI_INIT (m); _BI_INIT (tmp);
    4646
    47   bits = (const struct long_double_bits *)&x;
     47  bits = (const struct long_double_bits *)(void *)&x;
    4848  f = bits->mant;
    4949  e = bits->exp;
  • trunk/src/emx/src/lib/conv/smalatod.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    150150
    151151          saved_errno = errno; errno = 0;
    152           exp = strtol ((const char *)s, (char **)&q, 10);
     152          exp = strtol ((const char *)s, (char **)(void *)&q, 10);
    153153          if (errno == ERANGE)
    154154            {
  • trunk/src/emx/src/lib/io/_newstre.c

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r1516 r1517  
    77#include <sys/fmutex.h>
    88#include <stdio.h>
     9#include <string.h>
    910#include <emx/io.h>
    1011#include <emx/umalloc.h>
  • trunk/src/emx/src/lib/lgpl/string/strverscmp.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1516 r1517  
    1919   02111-1307 USA.  */
    2020
     21#include "libc-alias-glibc.h"
    2122#include <string.h>
    2223#include <ctype.h>
  • trunk/src/emx/src/lib/libc.def

    • Property cvs2svn:cvs-rev changed from 1.63 to 1.64
    r1516 r1517  
    238238    "___get_page" @260
    239239    "___getcwd" @261
    240     "___gnu_basename" @262
     240    "__std_chroot" @262
    241241    "___hash_open" @263
    242242    "___ibitmap" @264
     
    11771177    "___libc_OS2ErrorSet" @1197
    11781178    "__getdcwd" @1198
     1179    "___libc_Back_fsChRoot" @1202
     1180    "__std_getdtablesize" @1203
     1181    "_strmode" @1204
     1182    "___strverscmp" @1205
     1183    "___libc_timebomb" @1206
  • trunk/src/emx/src/lib/libc.smak

    • Property cvs2svn:cvs-rev changed from 1.45 to 1.46
    r1516 r1517  
    104104        $.omf/src/lib/sys/__init.obj
    105105LIBC.OBJS       := \
    106         $.omf/src/lib/startup/dll0hifork.obj \
     106        $.omf/src/lib/startup/dll0hi.obj \
    107107        $(LIBC.OBJS.COMMON)
    108108LIBC.LIBS       := $.omf/libc_s.lib $.omf/libc_app.lib
     
    114114LIBC.PRF.DEF    := $.omf/libc.prf.def
    115115LIBC.PRF.OBJS   := \
    116         $.omf/src/lib/startup/dll0hifork.obj \
     116        $.omf/src/lib/startup/dll0hi.obj \
    117117        $(subst /omf/,/omf-prof/,$(LIBC.OBJS.COMMON))
    118118LIBC.PRF.LIBS   := $.omf-prof/libc_p_s.lib $.omf-prof/libc_app_p.lib
     
    123123LIBC.ELH.DEF    := $.omf/libc.elh.def
    124124LIBC.ELH.OBJS   := \
    125         $.omf/src/lib/startup/dll0hifork.obj \
     125        $.omf/src/lib/startup/dll0hi.obj \
    126126        $.omf/src/lib/startup/dllinit.obj
    127127LIBC.ELH.LIBS   := $(LIBC.LIBS)
     
    132132LIBC.LOG.DEF    := $(LIBC.DEF)
    133133LIBC.LOG.OBJS   := \
    134         $.omf/src/lib/startup/dll0hifork.obj \
     134        $.omf/src/lib/startup/dll0hi.obj \
    135135        $(subst /omf/,/omf-log/,$(LIBC.OBJS.COMMON))
    136136LIBC.LOG.LIBS   := $.omf-log/libc_l_s.lib $.omf-log/libc_app_l.lib
  • trunk/src/emx/src/lib/mbyte/wctomb.c

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r1516 r1517  
    3434
    3535  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);
    3737  FS_RESTORE();
    3838  if (rc)
  • trunk/src/emx/src/lib/process/beginthr.c

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r1516 r1517  
    4747{
    4848    LIBCLOG_ENTER("pfnStart=%p pvStart=%p cbStack=%d pvArg=%p\n", pfnStart, pvStack, cbStack, pvArg);
    49     APIRET          rc;
     49    int             rc;
    5050    TID             tid;
    5151    __LIBC_PTHREAD  pThrd;
     
    8080     * Set errno and cleanup.
    8181     */
    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);
    8383    if (rc == ERROR_NOT_ENOUGH_MEMORY)
    8484        errno = ENOMEM;
  • trunk/src/emx/src/lib/process/execvp.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    88int _STD(execvp)(const char *name, char * const argv[])
    99{
    10     LIBCLOG_ENTER("name=%s argv=%s\n", name, argv);
     10    LIBCLOG_ENTER("name=%p:{%s} argv=%p\n", (void *)name, name, (void *)argv);
    1111    int rc = spawnvp(P_OVERLAY, name, argv);
    1212    LIBCLOG_RETURN_INT(rc);
  • trunk/src/emx/src/lib/process/execvpe.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    88int _STD(execvpe)(const char *name, char * const argv[], char * const envp[])
    99{
    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);
    1111    int rc = spawnvpe(P_OVERLAY, name, argv, envp);
    1212    LIBCLOG_RETURN_INT(rc);
  • trunk/src/emx/src/lib/startup/386/crt0.s

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r1516 r1517  
    3939__text:
    4040
    41 #if defined (FORK)
     41#if !defined(NOFORK) && !defined(NOUNIX)
    4242    /* Registering the fork module. If we're forking this call will not return. */
    4343    pushl   $1
     
    9090    .stabs  "___eh_term__", 21, 0, 0, 0xffffffff
    9191
    92 #if defined (FORK)
     92#if !defined(NOFORK) && !defined(NOUNIX)
    9393    .stabs "___fork_parent1__", 21, 0, 0, 0xffffffff
    9494    .stabs "___fork_child1__", 21, 0, 0, 0xffffffff
  • trunk/src/emx/src/lib/startup/386/dll0.s

    • Property cvs2svn:cvs-rev changed from 1.11 to 1.12
    r1516 r1517  
    4444     */
    4545do_common_init:
    46 #if defined(FORK)
     46#if !defined(NOFORK) && !defined(NOUNIX)
    4747    pushl   $0
    4848    pushl   $ForkModule
     
    106106    .stabs  "___eh_init__", 21, 0, 0, 0xffffffff
    107107    .stabs  "___eh_term__", 21, 0, 0, 0xffffffff
    108 #if defined (FORK)
     108#if !defined(NOFORK) && !defined(NOUNIX)
    109109    .stabs  "___fork_parent1__", 21, 0, 0, 0xffffffff
    110110    .stabs  "___fork_child1__", 21, 0, 0, 0xffffffff
  • trunk/src/emx/src/lib/startup/startup.smak

    • Property cvs2svn:cvs-rev changed from 1.14 to 1.15
    r1516 r1517  
    1818$(eval .OBJS += $.aout/src/lib/startup/crt0$(i).o)
    1919$$.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))))
    2121
    2222$(eval .OBJS += $.aout/src/lib/startup/dll0$(i).o)
    2323$$.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))))
    2525       
    2626$(eval .OBJS += $.omf/src/lib/startup/crt0$(i).obj)
     
    3434
    3535# generate
    36 $(foreach i,hi hifork hinoux hiforknoux fork forknoux noux,$(eval $(def_startup)))
     36$(foreach i,hi hinofork hinoux hinoforknoux nofork noforknoux noux,$(eval $(def_startup)))
    3737
    3838
  • trunk/src/emx/src/lib/sys/DosEx.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1516 r1517  
    4343#include <errno.h>
    4444#include <stdlib.h>
     45#include <string.h>
    4546#include <emx/startup.h>
    4647#include <386/builtin.h>
  • trunk/src/emx/src/lib/sys/__fcntl.c

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r1516 r1517  
    77#include <limits.h>
    88#include <io.h>
     9#include <string.h>
    910#define INCL_ERRORS
    1011#define INCL_FSMACROS
  • trunk/src/emx/src/lib/sys/__read.c

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r1516 r1517  
    7070         * Non-standard filehandle.
    7171         */
    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;
    7375    }
    7476
  • trunk/src/emx/src/lib/sys/__utimes.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    1616
    1717
    18 static void _sys_t2p(long sec, PFTIME time, PFDATE date)
     18static void _sys_t2p(time_t sec, PFTIME time, PFDATE date)
    1919{
    2020    struct tm *p;
  • trunk/src/emx/src/lib/sys/__write.c

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r1516 r1517  
    7979         * Non-standard filehandle.
    8080         */
    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;
    8284    }
    8385
  • trunk/src/emx/src/lib/sys/filehandles.c

    • Property cvs2svn:cvs-rev changed from 1.12 to 1.13
    r1516 r1517  
    459459 * @param   pfh Where to store the opened fake handle.
    460460 */
    461 static int __libc_fhOpenDummy(int fh, int *pfh)
     461static int fhOpenDummy(int fh, int *pfh)
    462462{
    463463    int     rc;
     
    466466    FS_VAR();
    467467
     468    /*
     469     * Open the NUL device.
     470     * If we're out of handle space, try increase it.
     471     */
    468472    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    }
    473485    if (!rc)
    474486    {
     487        /*
     488         * If the request was for a specific handle, we might have to dup it.
     489         */
    475490        if (fh != -1 && hFile != fh)
    476491        {
     
    729744             */
    730745            LIBC_ASSERTM(pOps, "cannot open a non-standard handle without giving pOps!\n");
    731             rc = __libc_fhOpenDummy(-1, &fh);
     746            rc = fhOpenDummy(-1, &fh);
    732747            if (!rc)
    733748            {
     
    760775        {
    761776            /*
    762              * Special handle.
     777             * Specific handle request.
    763778             * Make sure there are enough file handles available.
    764779             */
     
    772787                 * If not OS/2 filehandle, we have to make a fake handle.
    773788                 */
    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);
    776791
    777792                if (!rc)
  • trunk/src/emx/src/lib/sys/largefileio.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1516 r1517  
    7474     * Get a handle to DOSCALLS/DOSCALL1 which is suitable for DosQueryProcAddr.
    7575     */
    76     if (DosLoadModule(NULL, 0, "DOSCALLS", &hmod))
     76    if (DosLoadModule(NULL, 0, (PCSZ)"DOSCALLS", &hmod))
    7777    {
    7878        /* this is impossible! */
     
    8383    }
    8484
    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)
    8989          )
    9090    {
  • trunk/src/emx/src/lib/sys/libcfork.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1516 r1517  
    3636#define INCL_EXAPIS
    3737#define INCL_ERRORS
     38#define INCL_DOSINFOSEG
    3839#include <os2emx.h>
    3940#include <stdlib.h>
     
    147148/*//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\*/
    148149
     150#ifdef TIMEBOMB
     151static 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
    149168
    150169/**
     
    197216        LIBCLOG_RETURN_INT(-1);
    198217    }
     218#ifdef TIMEBOMB
     219    forkTimebomb();
     220#endif
    199221
    200222    /*
  • trunk/src/emx/src/lib/sys/logstrict.c

    • Property cvs2svn:cvs-rev changed from 1.12 to 1.13
    r1516 r1517  
    18051805                                ulValue = va_arg(args, signed long);
    18061806                            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. */
    18081808                            else
    18091809                                ulValue = va_arg(args, signed int);
  • trunk/src/emx/src/lib/sys/sharedpm.c

    • Property cvs2svn:cvs-rev changed from 1.6 to 1.7
    r1516 r1517  
    5959#define INCL_FPCWMACROS
    6060#define INCL_ERRORS
     61#define INCL_DOSINFOSEG
    6162#include <os2emx.h>
    6263#include <stdlib.h>
     
    112113static int  spmInit(void);
    113114static VOID APIENTRY spmExitList(ULONG ulReason);
     115static void spmCleanup(void);
    114116static void spmZombieOrFree(__LIBC_PSPMPROCESS pProcess);
    115117static unsigned spmTimestamp(void);
     
    136138
    137139/**
    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.
    140141 *
    141142 * @param   uReason     The OS/2 exit list type reason code.
     
    148149{
    149150    LIBCLOG_ENTER("enmDeathReason=%d iExitCode=%d\n", enmDeathReason, iExitCode);
    150     PPIB                    pPib;
    151     PTIB                    pTib;
    152151    __LIBC_SPMXCPTREGREC    RegRec;
    153     int                     fFree = 0;
    154152    FS_VAR();
    155153
     
    161159
    162160    /*
    163      * Cleanup current process.
    164      * Get pid before mutext as a speed and safety precaution.
     161     * Set return code and reason.
    165162     */
    166163    FS_SAVE_LOAD();
    167     DosGetInfoBlocks(&pTib, &pPib);
    168164    if (!spmRequestMutex(&RegRec))
    169165    {
    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 
    201166        /*
    202167         * Our selves.
     
    204169        if (gpSPMSelf)
    205170        {
    206             /* */
    207             pProcess = gpSPMSelf;
    208             gpSPMSelf = NULL;
    209 
    210171            /* 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;
    227176        }
    228177
     
    233182    }
    234183
    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
     189static 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}
    247199#endif
    248200
    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 }
    257201
    258202/**
     
    267211    LIBCLOG_ENTER("\n");
    268212    __LIBC_PSPMPROCESS pProcess;
     213
     214#ifdef TIMEBOMB
     215    spmTimebomb();
     216#endif
    269217
    270218    /*
     
    12991247static VOID APIENTRY spmExitList(ULONG ulReason)
    13001248{
     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     */
    13011253    if (ghmtxSPM)
    13021254    {
    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 
    13171255        /*
    13181256         * Terminate tcpip.
     
    13221260        if (gapfnSocketTerm[1])
    13231261            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        }
    13241276        __libc_spmTerm(ulReason, iExitCode);
     1277
     1278        /*
     1279         * Clean up the current process.
     1280         */
     1281        spmCleanup();
    13251282    }
    13261283
    13271284    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 */
     1292static 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();
    13281382}
    13291383
  • trunk/src/emx/src/lib/sys/tcpipver.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1516 r1517  
    3636#include "libc-alias.h"
    3737#include <errno.h>
     38#include <string.h>
    3839#include <sys/socket.h>
    3940#include <sys/sockio.h>
  • trunk/src/emx/src/lib/sys/usleep.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1516 r1517  
    106106        if (ulOldPri < (PRTYC_TIMECRITICAL << 8))
    107107        {
    108             LIBCLOG_MSG("current priority %#05x temporarily boosting priority\n", ulOldPri);
     108            LIBCLOG_MSG("current priority %#05lx temporarily boosting priority\n", ulOldPri);
    109109            DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
    110110        }
     
    117117        if (msSleep >= 30 && msSleep < 33)
    118118            msSleep = 33;
    119         LIBCLOG_MSG("DosSleep(%d)\n", msSleep);
     119        LIBCLOG_MSG("DosSleep(%ld)\n", msSleep);
    120120        DosSleep(msSleep);
    121121
    122122        if (ulOldPri < (PRTYC_TIMECRITICAL << 8))
    123123        {
    124             APIRET rc = DosSetPriority(PRTYS_THREAD, ulOldPri >> 8, ulOldPri & 0xff, 0);
     124            int rc = DosSetPriority(PRTYS_THREAD, ulOldPri >> 8, ulOldPri & 0xff, 0);
    125125            if (rc)
    126126            {
    127                 LIBCLOG_MSG("DosSetPriority(,%x,%x,0) failed with rc=%d\n",
     127                LIBCLOG_MSG("DosSetPriority(,%lx,%lx,0) failed with rc=%d\n",
    128128                            ulOldPri >> 8, ulOldPri & 0xff, rc);
    129129                //@todo add assertion.
     
    137137         * Simple DosSleep().
    138138         */
    139         LIBCLOG_MSG("DosSleep(%d)\n", msSleep);
     139        LIBCLOG_MSG("DosSleep(%ld)\n", msSleep);
    140140        DosSleep(msSleep);
    141141    }
  • trunk/src/emx/src/libsocket/getpeername.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    3939int getpeername(int socket, struct sockaddr *addr, int *addrlen)
    4040{
    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);
    4242    PLIBCSOCKETFH   pFHSocket = __libc_TcpipFH(socket);
    4343    if (pFHSocket)
  • trunk/src/emx/src/libsocket/getsockname.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1516 r1517  
    3939int getsockname(int socket, struct sockaddr *addr, int *addrlen)
    4040{
    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);
    4242    PLIBCSOCKETFH   pFHSocket = __libc_TcpipFH(socket);
    4343    if (pFHSocket)
  • trunk/src/emx/src/libsocket/getsockopt.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    3939int getsockopt(int socket, int level, int optname, void *optval, int *optlen)
    4040{
    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);
    4343    PLIBCSOCKETFH   pFHSocket = __libc_TcpipFH(socket);
    4444    if (pFHSocket)
  • trunk/src/emx/src/libsocket/recvfrom.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    3939int recvfrom(int socket, void *buf, int len, int flags, struct sockaddr *from, int *fromlen)
    4040{
    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);
    4343    PLIBCSOCKETFH   pFHSocket = __libc_TcpipFH(socket);
    4444    if (pFHSocket)
  • trunk/src/emx/src/libsocket/sendto.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1516 r1517  
    3939int sendto(int socket, const void *buf, int len, int flags, const struct sockaddr *to, int tolen)
    4040{
    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);
    4343    PLIBCSOCKETFH   pFHSocket = __libc_TcpipFH(socket);
    4444    if (pFHSocket)
Note: See TracChangeset for help on using the changeset viewer.