儲存庫 kBuild 的更動 1784
- 時間撮記:
- 2008-9-13 上午03:27:59 (16 年 以前)
- 位置:
- trunk/src/kash
- 檔案:
-
- 修改 6 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/kash/Makefile.kmk
r1665 r1784 38 38 kash_DEFS.linux = BSD 39 39 kash_DEFS.solaris = BSD 40 ## @todo bring over PC_SLASHES? 40 41 kash_DEFS.win = \ 41 42 BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS YY_NO_UNISTD_H … … 50 51 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME 51 52 kash_INCS = $(PATH_kash) . # (the last is because of error.h) 53 if "$(USER)" == "bird" && "$(KBUILD_TARGET)" != "win" 54 kash_CFLAGS += -std=gnu99 55 endif 52 56 kash_SOURCES = \ 53 57 main.c \ … … 97 101 strlcpy.c 98 102 99 kash_ ORDERDEPS = \103 kash_INTERMEDIATES = \ 100 104 $(PATH_kash)/arith.h \ 101 105 $(PATH_kash)/builtins.h \ … … 103 107 $(PATH_kash)/token.h 104 108 kash_CLEAN = \ 105 $(kash_ ORDERDEPS)\109 $(kash_INTERMEDIATES) \ 106 110 $(PATH_kash)/arith.c \ 107 111 $(PATH_kash)/arith_lex.c \ … … 118 122 119 123 120 if eq ($(filter-out win,$(KBUILD_TARGET)),)124 if1of ($(KBUILD_TARGET), win) 121 125 122 126 # … … 127 131 kash_SOURCES := $(patsubst $(PATH_kash)/%,generated/%,$(kash_SOURCES)) 128 132 129 include $(FILE_KBUILD_SUB_FOOTER)130 131 133 else 132 133 include $(FILE_KBUILD_SUB_FOOTER)134 134 135 135 # … … 142 142 # 143 143 BOOTSTRAP_SHELL ?= $(SHELL) 144 YACC ?= yacc 144 ifndef YACC 145 YACC := $(firstword $(which byacc) $(which yacc) yacc) 146 endif 145 147 146 $ (PATH_kash)/arith.h $(PATH_kash)/arith.c: arith.y | $(call DIRDEP,$(PATH_kash))148 $$(PATH_kash)/arith.h + $$(PATH_kash)/arith.c: arith.y | $$(dir $$@) 147 149 $(YACC) -ld $^ 148 150 $(MV) -f y.tab.c $(PATH_kash)/arith.c 149 151 $(MV) -f y.tab.h $(PATH_kash)/arith.h 150 152 151 $ (PATH_kash)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_kash))153 $$(PATH_kash)/arith_lex.c: $$(kash_DEFPATH)/arith_lex.l | $$(dir $$@) 152 154 flex -8 -o$@ $^ # 8-bit lex scanner for arithmetic 153 155 154 $(PATH_kash)/builtins.h $(PATH_kash)/builtins.c: $(kash_PATH)/mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_kash)) 156 $$(PATH_kash)/builtins.h + $$(PATH_kash)/builtins.c: \ 157 $$(kash_DEFPATH)/mkbuiltins \ 158 $$(kash_DEFPATH)/shell.h \ 159 $$(kash_DEFPATH)/builtins.def \ 160 | $$(dir $$@) 155 161 $(BOOTSTRAP_SHELL) $+ $(dir $@) 156 162 [ -f $(PATH_kash)/builtins.h ] 157 163 158 $(PATH_kash)/nodes.h $(PATH_kash)/nodes.c: $(kash_PATH)/mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_kash)) 164 $$(PATH_kash)/nodes.h + $$(PATH_kash)/nodes.c: \ 165 $$(kash_DEFPATH)/mknodes.sh \ 166 $$(kash_DEFPATH)/nodetypes \ 167 $$(kash_DEFPATH)/nodes.c.pat \ 168 | $$(dir $$@) 159 169 $(BOOTSTRAP_SHELL) $+ $(dir $@) 160 170 [ -f $(dir $@)/nodes.h ] 161 171 162 $ (PATH_kash)/token.h: $(kash_PATH)/mktokens | $(call DIRDEP,$(PATH_kash))172 $$(PATH_kash)/token.h: $$(kash_DEFPATH)/mktokens | $$(dir $$@) 163 173 $(BOOTSTRAP_SHELL) $+ 164 174 $(MV) token.h $@ 165 175 166 $(PATH_kash)/init.c: $(kash_PATH)/mkinit.sh $(filter-out $(PATH_kash)/%,$(kash_SOURCES)) | $(call DIRDEP,$(PATH_kash)) 176 $$(PATH_kash)/init.c: \ 177 $$(kash_DEFPATH)/mkinit.sh \ 178 $$(abspathex $$(filter-out $$(PATH_kash)/%,$$(kash_SOURCES)), $$(kash_DEFPATH)) \ 179 | $$(dir $$@) 167 180 $(BOOTSTRAP_SHELL) $+ 168 181 $(MV) init.c $@ 169 182 170 183 endif 184 185 include $(FILE_KBUILD_SUB_FOOTER) 186 -
trunk/src/kash/output.c
r1233 r1784 133 133 while (*p) 134 134 outc(*p++, file); 135 if (file == file->psh->out2)135 if (file->psh && file == file->psh->out2) 136 136 flushout(file); 137 137 } -
trunk/src/kash/shfile.h
r1240 r1784 91 91 # define R_OK 4 92 92 93 # define O_NONBLOCK 0 / // @todo93 # define O_NONBLOCK 0 /** @todo */ 94 94 95 95 #endif -
trunk/src/kash/shinstance.c
r1240 r1784 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 27 30 #include <string.h> 28 31 #include <stdlib.h> 32 #include <assert.h> 29 33 #ifndef _MSC_VER 30 34 # include <unistd.h> … … 35 39 36 40 41 /******************************************************************************* 42 * Global Variables * 43 *******************************************************************************/ 44 /** The mutex protecting the the globals and some shell instance members (sigs). */ 45 static shmtx g_sh_mtx; 46 /** The root shell instance. */ 47 static shinstance *g_sh_root; 48 /** The first shell instance. */ 49 static shinstance *g_sh_head; 50 /** The last shell instance. */ 51 static shinstance *g_sh_tail; 52 /** The number of shells. */ 53 static int g_num_shells; 54 /** Per signal state for determining a common denominator. 55 * @remarks defaults and unmasked actions aren't counted. */ 56 struct shsigstate 57 { 58 /** The current signal action. */ 59 #ifndef _MSC_VER 60 struct sigaction sa; 61 #else 62 struct 63 { 64 void (*sa_handler)(int); 65 int sa_flags; 66 shsigset_t sa_mask; 67 } sa; 68 #endif 69 /** The number of restarts (siginterrupt / SA_RESTART). */ 70 int num_restart; 71 /** The number of ignore handlers. */ 72 int num_ignore; 73 /** The number of specific handlers. */ 74 int num_specific; 75 /** The number of threads masking it. */ 76 int num_masked; 77 } g_sig_state[NSIG]; 78 79 80 81 typedef struct shmtxtmp { int i; } shmtxtmp; 82 83 int shmtx_init(shmtx *pmtx) 84 { 85 pmtx->b[0] = 0; 86 return 0; 87 } 88 89 void shmtx_delete(shmtx *pmtx) 90 { 91 pmtx->b[0] = 0; 92 } 93 94 void shmtx_enter(shmtx *pmtx, shmtxtmp *ptmp) 95 { 96 pmtx->b[0] = 0; 97 ptmp->i = 0; 98 } 99 100 void shmtx_leave(shmtx *pmtx, shmtxtmp *ptmp) 101 { 102 pmtx->b[0] = 0; 103 ptmp->i = 432; 104 } 105 106 107 /** 108 * Links the shell instance. 109 * 110 * @param psh The shell. 111 */ 112 static void sh_int_link(shinstance *psh) 113 { 114 shmtxtmp tmp; 115 shmtx_enter(&g_sh_mtx, &tmp); 116 117 if (psh->rootshell) 118 g_sh_root = psh; 119 120 psh->next = NULL; 121 psh->prev = g_sh_tail; 122 if (g_sh_tail) 123 g_sh_tail->next = psh; 124 else 125 g_sh_tail = g_sh_head = psh; 126 g_sh_tail = psh; 127 128 g_num_shells++; 129 130 shmtx_leave(&g_sh_mtx, &tmp); 131 } 132 133 134 /** 135 * Unlink the shell instance. 136 * 137 * @param psh The shell. 138 */ 139 static void sh_int_unlink(shinstance *psh) 140 { 141 shmtxtmp tmp; 142 shmtx_enter(&g_sh_mtx, &tmp); 143 144 g_num_shells--; 145 146 if (g_sh_tail == psh) 147 g_sh_tail = psh->prev; 148 else 149 psh->next->prev = psh->prev; 150 151 if (g_sh_head == psh) 152 g_sh_head = psh->next; 153 else 154 psh->prev->next = psh->next; 155 156 if (g_sh_root == psh) 157 g_sh_root = 0; 158 159 shmtx_leave(&g_sh_mtx, &tmp); 160 } 161 162 37 163 /** 38 164 * Creates a root shell instance. … … 47 173 { 48 174 shinstance *psh; 175 int i; 49 176 50 177 psh = calloc(sizeof(*psh), 1); … … 57 184 psh->pid = getpid(); 58 185 #endif 186 /*sh_sigemptyset(&psh->sigrestartset);*/ 187 for (i = 0; i < NSIG; i++) 188 psh->sigactions[i].sh_handler = SH_SIG_UNK; 59 189 60 190 /* memalloc.c */ … … 85 215 #if JOBS 86 216 psh->curjob = -1; 217 #else 218 # error asdf 87 219 #endif 88 220 psh->ttyfd = -1; 221 222 /* link it. */ 223 sh_int_link(psh); 89 224 90 225 } … … 98 233 return NULL; 99 234 #elif defined(SH_STUB_MODE) 235 (void)psh; 100 236 return getenv(var); 101 237 #else … … 109 245 return &s_null[0]; 110 246 #elif defined(SH_STUB_MODE) 247 (void)psh; 111 248 return environ; 112 249 #else … … 119 256 return NULL; 120 257 #elif defined(SH_STUB_MODE) 258 (void)psh; 121 259 # ifdef _MSC_VER 122 260 return NULL; … … 129 267 } 130 268 269 /** 270 * Lazy initialization of a signal state, globally. 271 * 272 * @param psh The shell doing the lazy work. 273 * @param signo The signal (valid). 274 */ 275 static void sh_int_lazy_init_sigaction(shinstance *psh, int signo) 276 { 277 if (psh->sigactions[signo].sh_handler == SH_SIG_UNK) 278 { 279 shmtxtmp tmp; 280 shmtx_enter(&g_sh_mtx, &tmp); 281 282 if (psh->sigactions[signo].sh_handler == SH_SIG_UNK) 283 { 284 shsigaction_t shold; 285 shinstance *cur; 286 #ifndef _MSC_VER 287 struct sigaction old; 288 if (!sigaction(signo, NULL, &old)) 289 { 290 /* convert */ 291 shold.sh_flags = old.sa_flags; 292 shold.sh_mask = old.sa_mask; 293 if (old.sa_handler == SIG_DFL) 294 shold.sh_handler = SH_SIG_DFL; 295 else 296 { 297 assert(old.sa_handler == SIG_IGN); 298 shold.sh_handler = SH_SIG_IGN; 299 } 300 } 301 else 302 #endif 303 { 304 /* fake */ 305 #ifndef _MSC_VER 306 assert(0); 307 old.sa_handler = SIG_DFL; 308 old.sa_flags = 0; 309 sigemptyset(&shold.sh_mask); 310 sigaddset(&shold.sh_mask, signo); 311 #endif 312 shold.sh_flags = 0; 313 sh_sigemptyset(&shold.sh_mask); 314 sh_sigaddset(&shold.sh_mask, signo); 315 shold.sh_handler = SH_SIG_DFL; 316 } 317 318 /* update globals */ 319 #ifndef _MSC_VER 320 g_sig_state[signo].sa = old; 321 #else 322 g_sig_state[signo].sa.sa_handle = SIG_DFL; 323 g_sig_state[signo].sa.sa_flags = 0; 324 g_sig_state[signo].sa.sa_mask = shold.sh_mask; 325 #endif 326 327 /* update all shells */ 328 for (cur = g_sh_head; cur; cur = cur->next) 329 { 330 assert(cur->sigactions[signo].sh_handler == SH_SIG_UNK); 331 cur->sigactions[signo] = shold; 332 } 333 } 334 335 shmtx_leave(&g_sh_mtx, &tmp); 336 } 337 } 338 339 340 /** 341 * Handler for external signals. 342 * 343 * @param signo The signal. 344 */ 345 static void sh_sig_common_handler(int signo) 346 { 347 348 } 349 350 131 351 int sh_sigaction(shinstance *psh, int signo, const struct shsigaction *newp, struct shsigaction *oldp) 132 352 { 133 #ifdef SH_PURE_STUB_MODE 134 return -1; 135 #elif defined(SH_STUB_MODE) 136 # ifdef _MSC_VER 137 return -1;138 # else 139 struct sigaction old;140 if (newp)353 printf("sh_sigaction: signo=%d newp=%p oldp=%p\n", signo, newp, oldp); 354 355 /* 356 * Input validation. 357 */ 358 if (signo >= NSIG || signo <= 0) 359 { 360 errno = EINVAL; 141 361 return -1; 142 if (sigaction(signo, NULL, &old)) 362 } 363 364 #ifdef SH_PURE_STUB_MODE 365 return -1; 366 #else 367 368 /* 369 * Make sure our data is correct. 370 */ 371 sh_int_lazy_init_sigaction(psh, signo); 372 373 /* 374 * Get the old one if requested. 375 */ 376 if (oldp) 377 *oldp = psh->sigactions[signo]; 378 379 /* 380 * Set the new one if it has changed. 381 * 382 * This will be attempted coordinated with the other signal handlers so 383 * that we can arrive at a common denominator. 384 */ 385 if ( newp 386 && memcmp(&psh->sigactions[signo], newp, sizeof(*newp))) 387 { 388 shmtxtmp tmp; 389 shmtx_enter(&g_sh_mtx, &tmp); 390 391 /* Undo the accounting for the current entry. */ 392 if (psh->sigactions[signo].sh_handler == SH_SIG_IGN) 393 g_sig_state[signo].num_ignore--; 394 else if (psh->sigactions[signo].sh_handler != SH_SIG_DFL) 395 g_sig_state[signo].num_specific--; 396 if (psh->sigactions[signo].sh_flags & SA_RESTART) 397 g_sig_state[signo].num_restart--; 398 399 /* Set the new entry. */ 400 psh->sigactions[signo] = *newp; 401 402 /* Add the bits for the new action entry. */ 403 if (psh->sigactions[signo].sh_handler == SH_SIG_IGN) 404 g_sig_state[signo].num_ignore++; 405 else if (psh->sigactions[signo].sh_handler != SH_SIG_DFL) 406 g_sig_state[signo].num_specific++; 407 if (psh->sigactions[signo].sh_flags & SA_RESTART) 408 g_sig_state[signo].num_restart++; 409 410 /* 411 * Calc new common action. 412 * 413 * This is quit a bit ASSUMPTIVE about the limited use. We will not 414 * bother synching the mask, and we pretend to care about SA_RESTART. 415 * The only thing we really actually care about is the sh_handler. 416 * 417 * On second though, it's possible we should just tie this to the root 418 * shell since it only really applies to external signal ... 419 */ 420 if ( g_sig_state[signo].num_specific 421 || g_sig_state[signo].num_ignore != g_num_shells) 422 g_sig_state[signo].sa.sa_handler = sh_sig_common_handler; 423 else if (g_sig_state[signo].num_ignore) 424 g_sig_state[signo].sa.sa_handler = SIG_DFL; 425 else 426 g_sig_state[signo].sa.sa_handler = SIG_DFL; 427 g_sig_state[signo].sa.sa_flags = psh->sigactions[signo].sh_flags & SA_RESTART; 428 429 # ifdef _MSC_VER 430 if (signal(signo, g_sig_state[signo].sa.sa_handler) == SIG_ERR) 431 # else 432 if (sigaction(signo, &g_sig_state[signo].sa, NULL)) 433 # endif 434 assert(0); 435 436 shmtx_leave(&g_sh_mtx, &tmp); 437 } 438 439 return 0; 440 #endif 441 } 442 443 shsig_t sh_signal(shinstance *psh, int signo, shsig_t handler) 444 { 445 shsigaction_t sa; 446 shsig_t ret; 447 448 /* 449 * Implementation using sh_sigaction. 450 */ 451 if (sh_sigaction(psh, signo, NULL, &sa)) 452 return SH_SIG_ERR; 453 454 ret = sa.sh_handler; 455 sa.sh_flags &= SA_RESTART; 456 sa.sh_handler = handler; 457 sh_sigemptyset(&sa.sh_mask); 458 sh_sigaddset(&sa.sh_mask, signo); /* ?? */ 459 if (sh_sigaction(psh, signo, &sa, NULL)) 460 return SH_SIG_ERR; 461 462 return ret; 463 } 464 465 int sh_siginterrupt(shinstance *psh, int signo, int interrupt) 466 { 467 shsigaction_t sa; 468 int oldflags = 0; 469 470 /* 471 * Implementation using sh_sigaction. 472 */ 473 if (sh_sigaction(psh, signo, NULL, &sa)) 143 474 return -1; 144 oldp->sh_flags = old.sa_flags; 145 oldp->sh_handler = old.sa_handler; 146 oldp->sh_mask = old.sa_mask; 147 return 0; 148 # endif 149 #else 150 #endif 151 } 152 153 shsig_t sh_signal(shinstance *psh, int signo, shsig_t handler) 154 { 155 return (shsig_t)-1; 156 } 157 158 int sh_siginterrupt(shinstance *psh, int signo, int interrupt) 159 { 160 return -1; 475 oldflags = sa.sh_flags; 476 if (interrupt) 477 sa.sh_flags &= ~SA_RESTART; 478 else 479 sa.sh_flags |= ~SA_RESTART; 480 if (!((oldflags ^ sa.sh_flags) & SA_RESTART)) 481 return 0; /* unchanged. */ 482 483 return sh_sigaction(psh, signo, &sa, NULL); 161 484 } 162 485 … … 166 489 } 167 490 491 void sh_sigaddset(shsigset_t *setp, int signo) 492 { 493 #ifdef _MSC_VER 494 *setp |= 1U << signo; 495 #else 496 sigaddset(setp, signo); 497 #endif 498 } 499 500 void sh_sigdelset(shsigset_t *setp, int signo) 501 { 502 #ifdef _MSC_VER 503 *setp &= ~(1U << signo); 504 #else 505 sigdelset(setp, signo); 506 #endif 507 } 508 509 int sh_sigismember(shsigset_t *setp, int signo) 510 { 511 #ifdef _MSC_VER 512 return !!(*setp & (1U << signo)); 513 #else 514 return !!sigismember(setp, signo); 515 #endif 516 } 517 168 518 int sh_sigprocmask(shinstance *psh, int operation, shsigset_t const *newp, shsigset_t *oldp) 169 519 { 170 return -1; 520 #ifdef SH_PURE_STUB_MODE 521 return -1; 522 #elif defined(SH_STUB_MODE) 523 (void)psh; 524 # ifdef _MSC_VER 525 return -1; 526 # else 527 return sigprocmask(operation, newp, oldp); 528 # endif 529 #else 530 #endif 171 531 } 172 532 … … 175 535 #ifdef SH_PURE_STUB_MODE 176 536 #elif defined(SH_STUB_MODE) 537 (void)psh; 177 538 abort(); 178 539 #else … … 184 545 #ifdef SH_PURE_STUB_MODE 185 546 #elif defined(SH_STUB_MODE) 547 (void)psh; 186 548 raise(SIGINT); 187 549 #else … … 194 556 return -1; 195 557 #elif defined(SH_STUB_MODE) 558 (void)psh; 196 559 # ifdef _MSC_VER 197 560 return -1; … … 209 572 return -1; 210 573 #elif defined(SH_STUB_MODE) 574 (void)psh; 211 575 # ifdef _MSC_VER 212 576 return -1; … … 224 588 return 0; 225 589 #elif defined(SH_STUB_MODE) 590 (void)psh; 226 591 # ifdef _MSC_VER 227 592 return 0; … … 251 616 return -1; 252 617 #elif defined(SH_STUB_MODE) 618 (void)psh; 253 619 # ifdef _MSC_VER 254 620 return -1; … … 266 632 return -1; 267 633 #elif defined(SH_STUB_MODE) 634 (void)psh; 268 635 # ifdef _MSC_VER 269 636 return -1; … … 282 649 return -1; 283 650 #elif defined(SH_STUB_MODE) 651 (void)psh; 284 652 _exit(rc); 285 653 #else … … 292 660 return -1; 293 661 #elif defined(SH_STUB_MODE) 662 (void)psh; 294 663 # ifdef _MSC_VER 295 664 return -1; … … 306 675 return 0; 307 676 #elif defined(SH_STUB_MODE) 677 (void)psh; 308 678 # ifdef _MSC_VER 309 679 return 0; … … 320 690 return 0; 321 691 #elif defined(SH_STUB_MODE) 692 (void)psh; 322 693 # ifdef _MSC_VER 323 694 return 0; … … 334 705 return 0; 335 706 #elif defined(SH_STUB_MODE) 707 (void)psh; 336 708 # ifdef _MSC_VER 337 709 return 0; … … 348 720 return 0; 349 721 #elif defined(SH_STUB_MODE) 722 (void)psh; 350 723 # ifdef _MSC_VER 351 724 return 0; … … 362 735 return 0; 363 736 #elif defined(SH_STUB_MODE) 737 (void)psh; 364 738 # ifdef _MSC_VER 365 739 return _getpid(); … … 376 750 return 0; 377 751 #elif defined(SH_STUB_MODE) 752 (void)psh; 378 753 # ifdef _MSC_VER 379 754 return _getpid(); … … 390 765 return pid; 391 766 #elif defined(SH_STUB_MODE) 767 (void)psh; 392 768 # ifdef _MSC_VER 393 769 return pid; … … 404 780 return -1; 405 781 #elif defined(SH_STUB_MODE) 782 (void)psh; 406 783 # ifdef _MSC_VER 407 784 return -1; … … 421 798 return -1; 422 799 #elif defined(SH_STUB_MODE) 800 (void)psh; 423 801 # ifdef _MSC_VER 424 802 return -1; … … 435 813 return -1; 436 814 #elif defined(SH_STUB_MODE) 815 (void)psh; 437 816 # ifdef _MSC_VER 438 817 return -1; … … 449 828 return -1; 450 829 #elif defined(SH_STUB_MODE) 830 (void)psh; 451 831 # ifdef _MSC_VER 452 832 return -1; … … 463 843 return -1; 464 844 #elif defined(SH_STUB_MODE) 845 (void)psh; 465 846 # ifdef _MSC_VER 466 847 return -1; -
trunk/src/kash/shinstance.h
r1240 r1784 43 43 #include "shthread.h" 44 44 #include "shfile.h" 45 #include "shell.h" 45 46 #include "output.h" 46 47 #include "options.h" … … 128 129 shtid tid; /**< The thread identifier of the thread for this shell. */ 129 130 shfdtab fdtab; /**< The file descriptor table. */ 131 shsigaction_t sigactions[NSIG]; /**< The signal actions registered with this shell instance. */ 130 132 131 133 /* alias.c */ … … 332 334 333 335 /* signals */ 334 typedef void (*shsig_t)(shinstance *, int); 335 #ifdef _MSC_VER 336 typedef uint32_t shsigset_t; 337 #else 338 typedef sigset_t shsigset_t; 339 #endif 340 struct shsigaction 341 { 342 shsig_t sh_handler; 343 shsigset_t sh_mask; 344 int sh_flags; 345 }; 336 #define SH_SIG_UNK ((shsig_t)(intptr_t)-199) 346 337 #define SH_SIG_DFL ((shsig_t)SIG_DFL) 347 338 #define SH_SIG_IGN ((shsig_t)SIG_IGN) 339 #define SH_SIG_ERR ((shsig_t)SIG_ERR) 348 340 #ifdef _MSC_VER 349 341 # define SIG_BLOCK 1 … … 370 362 int sh_siginterrupt(shinstance *, int, int); 371 363 void sh_sigemptyset(shsigset_t *); 364 int sh_sigfillset(shsigset_t *); 365 void sh_sigaddset(shsigset_t *, int); 366 void sh_sigdelset(shsigset_t *, int); 367 int sh_sigismember(shsigset_t *, int); 372 368 int sh_sigprocmask(shinstance *, int, shsigset_t const *, shsigset_t *); 373 369 void sh_abort(shinstance *) __attribute__((__noreturn__)); … … 418 414 pid_t sh_fork(shinstance *); 419 415 pid_t sh_waitpid(shinstance *, pid_t, int *, int); 420 void sh__exit(shinstance *, int) __attribute__((__noreturn__)); ;416 void sh__exit(shinstance *, int) __attribute__((__noreturn__)); 421 417 int sh_execve(shinstance *, const char *, const char * const*, const char * const *); 422 418 uid_t sh_getuid(shinstance *); -
trunk/src/kash/shtypes.h
r1286 r1784 32 32 #include <sys/types.h> 33 33 #include <stdlib.h> 34 #ifndef _MSC_VER 35 # include <sys/signal.h> 36 #endif 34 37 35 38 #ifdef _MSC_VER … … 96 99 typedef struct shinstance shinstance; 97 100 101 #ifdef _MSC_VER 102 typedef uint32_t shsigset_t; 103 #else 104 typedef sigset_t shsigset_t; 98 105 #endif 99 106 107 typedef void (*shsig_t)(shinstance *, int); 108 typedef struct shsigaction 109 { 110 shsig_t sh_handler; 111 shsigset_t sh_mask; 112 int sh_flags; 113 } shsigaction_t; 114 115 #endif 116
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器