Ignore:
Timestamp:
Oct 7, 2007, 10:39:58 PM (18 years ago)
Author:
bird
Message:

some more cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shinstance.h

    r1213 r1214  
    3333# include <termios.h>
    3434# include <sys/ioctl.h>
     35# include <sys/resource.h>
     36#endif
     37#include <errno.h>
     38#ifdef _MSC_VER
     39# define EWOULDBLOCK    512
    3540#endif
    3641
     
    324329extern shinstance *sh_create_root_shell(shinstance *, int, char **);
    325330char *sh_getenv(shinstance *, const char *);
     331const char *sh_gethomedir(shinstance *, const char *);
    326332
    327333/* signals */
    328334typedef void (*sh_sig_t)(shinstance *, int);
    329335#ifdef _MSC_VER
    330  typedef uint32_t sh_sigset_t;
     336    typedef uint32_t sh_sigset_t;
    331337#else
    332  typedef sigset_t sh_sigset_t;
     338    typedef sigset_t sh_sigset_t;
    333339#endif
    334340struct sh_sigaction
     
    341347#define SH_SIG_IGN ((sh_sig_t)SIG_IGN)
    342348#ifdef _MSC_VER
    343 # define SIG_BLOCK          1
    344 # define SIG_UNBLOCK        2
    345 # define SIG_SETMASK        3
    346 # define SIGHUP             5
    347 # define SIGQUIT            9
    348 # define SIGPIPE            12
    349 # define SIGTTOU            17
    350 # define SIGTSTP            18
    351 # define SIGTTIN            19
    352 # define SIGCONT            20
     349#   define SIG_BLOCK         1
     350#   define SIG_UNBLOCK       2
     351#   define SIG_SETMASK       3
     352#   define SIGHUP            5
     353#   define SIGQUIT           9
     354#   define SIGPIPE          12
     355#   define SIGTTOU          17
     356#   define SIGTSTP          18
     357#   define SIGTTIN          19
     358#   define SIGCONT          20
     359    extern const char * const sys_siglist[NSIG];
    353360#endif /* _MSC_VER */
     361#ifdef __sun__
     362#   define sys_siglist _sys_siglist
     363#endif
    354364
    355365int sh_sigaction(int, const struct sh_sigaction *, struct sh_sigaction *);
    356366sh_sig_t sh_signal(shinstance *, int, sh_sig_t);
    357 void sh_raise_sigint(shinstance *);
     367int sh_siginterrupt(shinstance *, int, int);
    358368void sh_sigemptyset(sh_sigset_t *);
    359369int sh_sigprocmask(shinstance *, int, sh_sigset_t const *, sh_sigset_t *);
    360370void sh_abort(shinstance *);
     371void sh_raise_sigint(shinstance *);
     372int sh_kill(shinstance *, pid_t, int);
     373int sh_killpg(shinstance *, pid_t, int);
    361374
    362375/* times */
     
    371384    } sh_tms;
    372385#else
     386#   include <sys/times.h>
    373387#   include <times.h>
    374388    typedef struct tms sh_tms;
     
    400414#   include <sys/wait.h>
    401415#endif
     416pid_t sh_fork(shinstance *);
    402417pid_t sh_waitpid(shinstance *, pid_t, int *, int);
    403418void sh__exit(shinstance *, int);
     
    411426pid_t sh_getpgid(shinstance *, pid_t);
    412427int sh_setpgid(shinstance *, pid_t, pid_t);
    413 int sh_kill(shinstance *, pid_t, int);
    414 int sh_killpg(shinstance *, pid_t, int);
    415428
    416429/* tc* */
     
    418431int sh_tcsetpgrp(shinstance *, int, pid_t);
    419432
    420 #endif
     433/* sys/resourece.h */
     434#ifdef _MSC_VER
     435    typedef int64_t shrlim_t;
     436    typedef struct shrlimit
     437    {
     438        shrlim_t   rlim_cur;
     439        shrlim_t   rlim_max;
     440    } shrlimit;
     441#   define RLIMIT_CPU     0
     442#   define RLIMIT_FSIZE   1
     443#   define RLIMIT_DATA    2
     444#   define RLIMIT_STACK   3
     445#   define RLIMIT_CORE    4
     446#   define RLIMIT_RSS     5
     447#   define RLIMIT_MEMLOCK 6
     448#   define RLIMIT_NPROC   7
     449#   define RLIMIT_NOFILE  8
     450#   define RLIMIT_SBSIZE  9
     451#   define RLIMIT_VMEM    10
     452#   define RLIM_NLIMITS   11
     453#   define RLIM_INFINITY  (0x7fffffffffffffffLL)
     454#else
     455    typedef rlim_t          shrlim_t;
     456    typedef struct rlimit   shrlimit;
     457#endif
     458int sh_getrlimit(shinstance *, int, shrlimit *);
     459int sh_setrlimit(shinstance *, int, const shrlimit *);
     460
     461#endif
Note: See TracChangeset for help on using the changeset viewer.