儲存庫 kBuild 的更動 2287
- 時間撮記:
- 2009-2-25 上午05:40:29 (16 年 以前)
- 位置:
- trunk/src/kash
- 檔案:
-
- 修改 4 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/kash/Makefile.kmk
r2282 r2287 126 126 # Use the pregenerated code. 127 127 # 128 kash_ ORDERDEPS :=128 kash_INTERMEDIATES := 129 129 kash_INCS += generated 130 130 kash_SOURCES := $(patsubst $(PATH_kash)/%,generated/%,$(kash_SOURCES)) -
trunk/src/kash/shinstance.c
r2286 r2287 651 651 } 652 652 653 int sh_sigismember(shsigset_t *setp, int signo)653 int sh_sigismember(shsigset_t const *setp, int signo) 654 654 { 655 655 #ifdef _MSC_VER … … 689 689 for (rc = 0; rc < NSIG; rc++) 690 690 if (sh_sigismember(newp, rc)) 691 sh_sigaddset(&mask );691 sh_sigaddset(&mask, rc); 692 692 break; 693 693 case SIG_UNBLOCK: 694 694 for (rc = 0; rc < NSIG; rc++) 695 695 if (sh_sigismember(newp, rc)) 696 sh_sigdelset(&mask );696 sh_sigdelset(&mask, rc); 697 697 break; 698 698 case SIG_SETMASK: … … 862 862 # else 863 863 pid = -1; 864 err or= ENOSYS;864 errno = ENOSYS; 865 865 # endif 866 866 # else … … 888 888 # ifdef _MSC_VER 889 889 pidret = -1; 890 err or= ENOSYS;890 errno = ENOSYS; 891 891 # else 892 892 pidret = waitpid(pid, statusp, flags); … … 919 919 int sh_execve(shinstance *psh, const char *exe, const char * const *argv, const char * const *envp) 920 920 { 921 #ifdef _MSC_VER 922 intptr_t rc; 923 #else 921 924 int rc; 925 #endif 922 926 923 927 #ifdef DEBUG … … 946 950 TRACE2((psh, "sh_execve -> %d [%d]\n", rc, errno)); 947 951 (void)psh; 952 return (int)rc; 953 } 954 955 uid_t sh_getuid(shinstance *psh) 956 { 957 #ifdef SH_PURE_STUB_MODE 958 uid_t uid = 0; 959 960 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 961 # ifdef _MSC_VER 962 uid_t uid = 0; 963 # else 964 uid_t uid = getuid(); 965 # endif 966 967 #else 968 #endif 969 970 TRACE2((psh, "sh_getuid() -> %d [%d]\n", uid, errno)); 971 (void)psh; 972 return uid; 973 } 974 975 uid_t sh_geteuid(shinstance *psh) 976 { 977 #ifdef SH_PURE_STUB_MODE 978 uid_t euid = 0; 979 980 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 981 # ifdef _MSC_VER 982 uid_t euid = 0; 983 # else 984 uid_t euid = geteuid(); 985 # endif 986 987 #else 988 #endif 989 990 TRACE2((psh, "sh_geteuid() -> %d [%d]\n", euid, errno)); 991 (void)psh; 992 return euid; 993 } 994 995 gid_t sh_getgid(shinstance *psh) 996 { 997 #ifdef SH_PURE_STUB_MODE 998 gid_t gid = 0; 999 1000 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 1001 # ifdef _MSC_VER 1002 gid_t gid = 0; 1003 # else 1004 gid_t gid = getgid(); 1005 # endif 1006 1007 #else 1008 #endif 1009 1010 TRACE2((psh, "sh_getgid() -> %d [%d]\n", gid, errno)); 1011 (void)psh; 1012 return gid; 1013 } 1014 1015 gid_t sh_getegid(shinstance *psh) 1016 { 1017 #ifdef SH_PURE_STUB_MODE 1018 gid_t egid = 0; 1019 1020 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 1021 # ifdef _MSC_VER 1022 gid_t egid = 0; 1023 # else 1024 gid_t egid = getegid(); 1025 # endif 1026 1027 #else 1028 #endif 1029 1030 TRACE2((psh, "sh_getegid() -> %d [%d]\n", egid, errno)); 1031 (void)psh; 1032 return egid; 1033 } 1034 1035 pid_t sh_getpid(shinstance *psh) 1036 { 1037 pid_t pid; 1038 1039 #ifdef SH_PURE_STUB_MODE 1040 pid = 0; 1041 1042 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 1043 # ifdef _MSC_VER 1044 pid = _getpid(); 1045 # else 1046 pid = getpid(); 1047 # endif 1048 #else 1049 #endif 1050 1051 (void)psh; 1052 return pid; 1053 } 1054 1055 pid_t sh_getpgrp(shinstance *psh) 1056 { 1057 #ifdef SH_PURE_STUB_MODE 1058 pid_t pgrp = 0; 1059 1060 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 1061 # ifdef _MSC_VER 1062 pid_t pgrp = _getpid(); 1063 # else 1064 pid_t pgrp = getpgrp(); 1065 # endif 1066 1067 #else 1068 #endif 1069 1070 TRACE2((psh, "sh_getpgrp() -> %d [%d]\n", pgrp, errno)); 1071 (void)psh; 1072 return pgrp; 1073 } 1074 1075 pid_t sh_getpgid(shinstance *psh, pid_t pid) 1076 { 1077 #ifdef SH_PURE_STUB_MODE 1078 pid_t pgid = pid; 1079 1080 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 1081 # ifdef _MSC_VER 1082 pid_t pgid = pid; 1083 # else 1084 pid_t pgid = getpgid(pid); 1085 # endif 1086 1087 #else 1088 #endif 1089 1090 TRACE2((psh, "sh_getpgid(%d) -> %d [%d]\n", pid, pgid, errno)); 1091 (void)psh; 1092 return pgid; 1093 } 1094 1095 int sh_setpgid(shinstance *psh, pid_t pid, pid_t pgid) 1096 { 1097 #ifdef SH_PURE_STUB_MODE 1098 int rc = -1; 1099 1100 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE) 1101 # ifdef _MSC_VER 1102 int rc = -1; 1103 errno = ENOSYS; 1104 # else 1105 int rc = setpgid(pid, pgid); 1106 # endif 1107 1108 #else 1109 #endif 1110 1111 TRACE2((psh, "sh_setpgid(%d, %d) -> %d [%d]\n", pid, pgid, rc, errno)); 1112 (void)psh; 948 1113 return rc; 949 1114 } 950 1115 951 uid_t sh_getuid(shinstance *psh)952 {953 #ifdef SH_PURE_STUB_MODE954 uid_t uid = 0;955 956 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)957 # ifdef _MSC_VER958 uid_t uid = 0;959 # else960 uid_t uid = getuid();961 # endif962 963 #else964 #endif965 966 TRACE2((psh, "sh_getuid() -> %d [%d]\n", uid, errno));967 (void)psh;968 return uid;969 }970 971 uid_t sh_geteuid(shinstance *psh)972 {973 #ifdef SH_PURE_STUB_MODE974 uid_t euid = 0;975 976 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)977 # ifdef _MSC_VER978 uid_t euid = 0;979 # else980 uid_t euid = geteuid();981 # endif982 983 #else984 #endif985 986 TRACE2((psh, "sh_geteuid() -> %d [%d]\n", euid, errno));987 (void)psh;988 return euid;989 }990 991 gid_t sh_getgid(shinstance *psh)992 {993 #ifdef SH_PURE_STUB_MODE994 gid_t gid = 0;995 996 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)997 # ifdef _MSC_VER998 gid_t gid = 0;999 # else1000 gid_t gid = getgid();1001 # endif1002 1003 #else1004 #endif1005 1006 TRACE2((psh, "sh_getgid() -> %d [%d]\n", gid, errno));1007 (void)psh;1008 return gid;1009 }1010 1011 gid_t sh_getegid(shinstance *psh)1012 {1013 #ifdef SH_PURE_STUB_MODE1014 gid_t egid = 0;1015 1016 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)1017 # ifdef _MSC_VER1018 gid_t egid = 0;1019 # else1020 gid_t egid = getegid();1021 # endif1022 1023 #else1024 #endif1025 1026 TRACE2((psh, "sh_getegid() -> %d [%d]\n", egid, errno));1027 (void)psh;1028 return egid;1029 }1030 1031 pid_t sh_getpid(shinstance *psh)1032 {1033 pid_t pid;1034 1035 #ifdef SH_PURE_STUB_MODE1036 pid = 0;1037 1038 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)1039 # ifdef _MSC_VER1040 pid = _getpid();1041 # else1042 pid = getpid();1043 # endif1044 #else1045 #endif1046 1047 (void)psh;1048 return pid;1049 }1050 1051 pid_t sh_getpgrp(shinstance *psh)1052 {1053 #ifdef SH_PURE_STUB_MODE1054 pid_t pgrp = 0;1055 1056 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)1057 # ifdef _MSC_VER1058 pid_t pgrp _getpid();1059 # else1060 pid_t pgrp = getpgrp();1061 # endif1062 1063 #else1064 #endif1065 1066 TRACE2((psh, "sh_getpgrp() -> %d [%d]\n", pgrp, errno));1067 (void)psh;1068 return pgrp;1069 }1070 1071 pid_t sh_getpgid(shinstance *psh, pid_t pid)1072 {1073 #ifdef SH_PURE_STUB_MODE1074 pid_t pgid = pid;1075 1076 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)1077 # ifdef _MSC_VER1078 pid_t pgid = pid;1079 # else1080 pid_t pgid = getpgid(pid);1081 # endif1082 1083 #else1084 #endif1085 1086 TRACE2((psh, "sh_getpgid(%d) -> %d [%d]\n", pid, pgid, errno));1087 (void)psh;1088 return pgid;1089 }1090 1091 int sh_setpgid(shinstance *psh, pid_t pid, pid_t pgid)1092 {1093 #ifdef SH_PURE_STUB_MODE1094 int rc = -1;1095 1096 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)1097 # ifdef _MSC_VER1098 int rc = -1;1099 error = ENOSYS;1100 # else1101 int rc = setpgid(pid, pgid);1102 # endif1103 1104 #else1105 #endif1106 1107 TRACE2((psh, "sh_setpgid(%d, %d) -> %d [%d]\n", pid, pgid, rc, errno));1108 (void)psh;1109 return rc;1110 }1111 1112 1116 pid_t sh_tcgetpgrp(shinstance *psh, int fd) 1113 1117 { … … 1120 1124 # ifdef _MSC_VER 1121 1125 pgrp = -1; 1122 err or= ENOSYS;1126 errno = ENOSYS; 1123 1127 # else 1124 1128 pgrp = tcgetpgrp(fd); … … 1144 1148 # ifdef _MSC_VER 1145 1149 rc = -1; 1146 err or= ENOSYS;1150 errno = ENOSYS; 1147 1151 # else 1148 1152 rc = tcsetpgrp(fd, pgrp); … … 1165 1169 # ifdef _MSC_VER 1166 1170 int rc = -1; 1167 err or= ENOSYS;1171 errno = ENOSYS; 1168 1172 # else 1169 1173 int rc = getrlimit(resid, limp); … … 1188 1192 # ifdef _MSC_VER 1189 1193 int rc = -1; 1190 err or= ENOSYS;1194 errno = ENOSYS; 1191 1195 # else 1192 1196 int rc = setrlimit(resid, limp); -
trunk/src/kash/shinstance.h
r2286 r2287 342 342 #define SH_SIG_ERR ((shsig_t)SIG_ERR) 343 343 #ifdef _MSC_VER 344 # define SA_RESTART 0x02 344 345 # define SIG_BLOCK 1 345 346 # define SIG_UNBLOCK 2 … … 368 369 void sh_sigaddset(shsigset_t *, int); 369 370 void sh_sigdelset(shsigset_t *, int); 370 int sh_sigismember(shsigset_t *, int);371 int sh_sigismember(shsigset_t const *, int); 371 372 int sh_sigprocmask(shinstance *, int, shsigset_t const *, shsigset_t *); 372 373 void sh_abort(shinstance *) __attribute__((__noreturn__)); -
trunk/src/kash/show.c
r2280 r2287 433 433 fd = shfile_open(&psh->fdtab, s, O_APPEND | O_RDWR | O_CREAT, 0600); 434 434 if (fd != -1) { 435 int fd2 = fcntl(fd, F_DUPFD, 199);435 int fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 199); 436 436 if (fd2 == -1) 437 fd2 = fcntl(fd, F_DUPFD, 99);437 fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 99); 438 438 if (fd2 == -1) 439 fd2 = fcntl(fd, F_DUPFD, 49);439 fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 49); 440 440 if (fd2 == -1) 441 fd2 = fcntl(fd, F_DUPFD, 18);441 fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 18); 442 442 if (fd2 == -1) 443 fd2 = fcntl(fd, F_DUPFD, 10);443 fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 10); 444 444 if (fd2 != -1) { 445 445 close(fd); … … 453 453 } 454 454 } 455 setvbuf(tracefile, (char *)NULL, _IOLBF, 0); //setlinebuf(tracefile);455 setvbuf(tracefile, (char *)NULL, _IOLBF, 1024); 456 456 fputs("\nTracing started.\n", tracefile); 457 457 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器