Ignore:
Timestamp:
Apr 22, 2007, 12:17:42 AM (18 years ago)
Author:
bird
Message:

hacking...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ash-messup/shinstance.h

    r883 r884  
    138138    int                 back_exitstatus;/**< exit status of backquoted command */
    139139    struct strlist     *cmdenviron;     /**< environment for builtin command */
    140     int                 funcnest;
    141     int                 evalskip;
     140    int                 funcnest;       /**< depth of function calls */
     141    int                 evalskip;       /**< set if we are skipping commands */
     142    int                 skipcount;      /**< number of levels to skip */
     143    int                 loopnest;       /**< current loop nesting level */
    142144
    143145    /* builtins.h */
     
    156158    char                errmsg_buf[16]; /**< static in errmsg. (bss) */
    157159
     160    /* eval.c */
     161    int                 vforked;
    158162} shinstance;
    159163
     
    165169#include <signal.h>
    166170#ifdef _MSC_VER
    167 typedef uint32_t sh_sigset_t;
     171    typedef uint32_t sh_sigset_t;
    168172#else
    169 typedef sigset_t sh_sigset_t;
     173    typedef sigset_t sh_sigset_t;
    170174#endif
    171175
     
    176180int sh_sigprocmask(shinstance *, int op, sh_sigset_t const *new, sh_sigset_t *old);
    177181
    178 #endif
     182/* times */
     183#include <time.h>
     184#ifdef _MSC_VER
     185    typedef struct sh_tms
     186    {
     187        clock_t tms_utime;
     188        clock_t tms_stime;
     189        clock_t tms_cutime;
     190        clock_t tms_cstime;
     191    } sh_tms;
     192#else
     193#   include <times.h>
     194    typedef struct tms sh_tms;
     195#endif
     196clock_t sh_times(sh_tms *);
     197int sh_sysconf_clk_tck(void);
     198
     199/* wait */
     200#ifdef _MSC_VER
     201#   include <process.h>
     202#   define WNOHANG         1       /* Don't hang in wait. */
     203#   define WUNTRACED       2       /* Tell about stopped, untraced children. */
     204#   define WCONTINUED      4       /* Report a job control continued process. */
     205#   define _W_INT(w)       (*(int *)&(w))  /* Convert union wait to int. */
     206#   define WCOREFLAG       0200
     207#   define _WSTATUS(x)     (_W_INT(x) & 0177)
     208#   define _WSTOPPED       0177            /* _WSTATUS if process is stopped */
     209#   define WIFSTOPPED(x)   (_WSTATUS(x) == _WSTOPPED)
     210#   define WSTOPSIG(x)     (_W_INT(x) >> 8)
     211#   define WIFSIGNALED(x)  (_WSTATUS(x) != 0 && !WIFSTOPPED(x) && !WIFCONTINUED(x)) /* bird: made GLIBC tests happy. */
     212#   define WTERMSIG(x)     (_WSTATUS(x))
     213#   define WIFEXITED(x)    (_WSTATUS(x) == 0)
     214#   define WEXITSTATUS(x)  (_W_INT(x) >> 8)
     215#   define WIFCONTINUED(x) (x == 0x13)     /* 0x13 == SIGCONT */
     216#   define WCOREDUMP(x)    (_W_INT(x) & WCOREFLAG)
     217#   define W_EXITCODE(ret, sig)    ((ret) << 8 | (sig))
     218#   define W_STOPCODE(sig)         ((sig) << 8 | _WSTOPPED)
     219#else
     220#   include <sys/wait.h>
     221#endif
     222pid_t sh_waitpid(shinstance *, pid_t, int *, int);
     223void sh__exit(shinstance *, int);
     224
     225#endif
Note: See TracChangeset for help on using the changeset viewer.