????

???OpenSolaris ?????????????????????b135 ??? syscall.h ??? wait, creat, exec, utime, dup, fork(forkall) ???????????????????? 2 ??? fork(?? forkall) ????????????????????????????????48 ?? signal ???????? b128 ??????????????

??????????????????????????????????Solaris ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????creat ? fork ???????????????????? creat(2) ? fork(2) ?????????????????????????????Solaris ??????????? ABI ?????????????????????????????????????????????????? ????????

?????????

???????????????????????????????????

?????????? sysent.c ??? sysent[] ????????????????sysent[] ????????????????????????????????write ??????????? 4 ?????sysent[4] ?? write ?????????????? -- SYSENT_CL("write", write, 3) -- ????????

sysent[] ??????? (was ...) ???????????????????????????????2 ?? forkall ? 7 ?? wait ? SYSENT_LOADABLE() ???????????????????????????????????

415 struct sysent sysent[NSYSCALL] = 416 { 417 /* ONC_PLUS EXTRACT END */ 418 /* 0 */ IF_LP64( 419 SYSENT_NOSYS(), 420 SYSENT_C("indir", indir, 1)), 421 /* 1 */ SYSENT_CI("exit", rexit, 1), 422 /* 2 */ SYSENT_LOADABLE(), /* (was forkall) */ 423 /* 3 */ SYSENT_CL("read", read, 3), 424 /* 4 */ SYSENT_CL("write", write, 3), 425 /* 5 */ SYSENT_CI("open", open, 3), 426 /* 6 */ SYSENT_CI("close", close, 1), 427 /* 7 */ SYSENT_LOADABLE(), /* (was wait) */ 428 /* 8 */ SYSENT_LOADABLE(), /* (was creat) */ 429 /* 9 */ SYSENT_CI("link", link, 2), 430 /* 10 */ SYSENT_CI("unlink", unlink, 1), 431 /* 11 */ SYSENT_LOADABLE(), /* (was exec) */ ...((http://src.opensolaris.org/source/xr...on/os/sysent.c))syscall.h ?? sysent[] ???????????????????????????????? include ???????????????????????????????????????? sysent.c ????2, 7, 8, 11 ???????????????????

50 #define SYS_syscall 0 51 #define SYS_exit 1 52 #define SYS_read 3 53 #define SYS_write 4 54 #define SYS_open 5 55 #define SYS_close 6 56 #define SYS_link 9 57 #define SYS_unlink 10 58 #define SYS_chdir 12((http://src.opensolaris.org/source/xr.../sys/syscall.h))syscall.h ??????????????? creat ?????????????????

... 12 @@ -49,16 +49,12 @@ 13 14 #define SYS_syscall 0 15 #define SYS_exit 1 16 -#define SYS_forkall 2 17 #define SYS_read 3 18 #define SYS_write 4 19 #define SYS_open 5 20 #define SYS_close 6 21 -#define SYS_wait 7 22 -#define SYS_creat 8 23 #define SYS_link 9 24 #define SYS_unlink 10 25 -#define SYS_exec 11 ...((http://hg.genunix.org/onnv-gate.hg/d.../sys/syscall.h)) ?????????

????????????????????????

???????????? NSYSCALL ?????????????sysent[] ????? NSYSCALL ??????????????? NSYSCALL ? 256 ????????????? 256 ??????????????????????????

347 #define NSYSCALL 256 /* number of system calls */((http://src.opensolaris.org/source/xr...ys/systm.h#347))256 ?????????????????????????????????????????????????? ???? msyget, msgctl, msgrcv, msgsnd, msgids, msgsnap ? SYS_msgsys ???????????msgsys() ?? 1 ??? 0 ???????????msgget() ??????????????

100 #define SYS_msgsys 49 101 /* 102 * subcodes: 103 * msgget(...) :: msgsys(0, ...) 104 * msgctl(...) :: msgsys(1, ...) 105 * msgrcv(...) :: msgsys(2, ...) 106 * msgsnd(...) :: msgsys(3, ...) 107 * msgids(...) :: msgsys(4, ...) 108 * msgsnap(...) :: msgsys(5, ...) 109 * see 110 */((http://src.opensolaris.org/source/xr.../sys/syscall.h)) ?????????

?????????????????????????????????????????????????? ????????????????????????????fork(2) ?????????????????? sysent[] ? fork ????????????????????????????????

415 struct sysent sysent[NSYSCALL] = 416 { 417 /* ONC_PLUS EXTRACT END */ 418 /* 0 */ IF_LP64( 419 SYSENT_NOSYS(), 420 SYSENT_C("indir", indir, 1)), 421 /* 1 */ SYSENT_CI("exit", rexit, 1), 422 /* 2 */ SYSENT_LOADABLE(), /* (was forkall) */ ul_vfork = 0; 169 } 170 return (pid);((http://src.opensolaris.org/source/xr...scalls.c#forkx))__forkx() ? SYSTRAP_2RVALS(forksys) ?????????????SYSTRAP_2RVALS() ???????

44 ENTRY(__forkx) 45 movl %edi, %esi 46 xorl %edi, %edi 47 SYSTRAP_2RVALS(forksys)