Changeset 1214 for trunk/src/kash/shinstance.h
- Timestamp:
- Oct 7, 2007, 10:39:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/shinstance.h
r1213 r1214 33 33 # include <termios.h> 34 34 # include <sys/ioctl.h> 35 # include <sys/resource.h> 36 #endif 37 #include <errno.h> 38 #ifdef _MSC_VER 39 # define EWOULDBLOCK 512 35 40 #endif 36 41 … … 324 329 extern shinstance *sh_create_root_shell(shinstance *, int, char **); 325 330 char *sh_getenv(shinstance *, const char *); 331 const char *sh_gethomedir(shinstance *, const char *); 326 332 327 333 /* signals */ 328 334 typedef void (*sh_sig_t)(shinstance *, int); 329 335 #ifdef _MSC_VER 330 typedef uint32_t sh_sigset_t;336 typedef uint32_t sh_sigset_t; 331 337 #else 332 typedef sigset_t sh_sigset_t;338 typedef sigset_t sh_sigset_t; 333 339 #endif 334 340 struct sh_sigaction … … 341 347 #define SH_SIG_IGN ((sh_sig_t)SIG_IGN) 342 348 #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]; 353 360 #endif /* _MSC_VER */ 361 #ifdef __sun__ 362 # define sys_siglist _sys_siglist 363 #endif 354 364 355 365 int sh_sigaction(int, const struct sh_sigaction *, struct sh_sigaction *); 356 366 sh_sig_t sh_signal(shinstance *, int, sh_sig_t); 357 void sh_raise_sigint(shinstance *);367 int sh_siginterrupt(shinstance *, int, int); 358 368 void sh_sigemptyset(sh_sigset_t *); 359 369 int sh_sigprocmask(shinstance *, int, sh_sigset_t const *, sh_sigset_t *); 360 370 void sh_abort(shinstance *); 371 void sh_raise_sigint(shinstance *); 372 int sh_kill(shinstance *, pid_t, int); 373 int sh_killpg(shinstance *, pid_t, int); 361 374 362 375 /* times */ … … 371 384 } sh_tms; 372 385 #else 386 # include <sys/times.h> 373 387 # include <times.h> 374 388 typedef struct tms sh_tms; … … 400 414 # include <sys/wait.h> 401 415 #endif 416 pid_t sh_fork(shinstance *); 402 417 pid_t sh_waitpid(shinstance *, pid_t, int *, int); 403 418 void sh__exit(shinstance *, int); … … 411 426 pid_t sh_getpgid(shinstance *, pid_t); 412 427 int sh_setpgid(shinstance *, pid_t, pid_t); 413 int sh_kill(shinstance *, pid_t, int);414 int sh_killpg(shinstance *, pid_t, int);415 428 416 429 /* tc* */ … … 418 431 int sh_tcsetpgrp(shinstance *, int, pid_t); 419 432 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 458 int sh_getrlimit(shinstance *, int, shrlimit *); 459 int sh_setrlimit(shinstance *, int, const shrlimit *); 460 461 #endif
Note:
See TracChangeset
for help on using the changeset viewer.