VirtualBox

儲存庫 kBuild 的更動 2287


忽略:
時間撮記:
2009-2-25 上午05:40:29 (16 年 以前)
作者:
bird
訊息:

kash: windows build fixes.

位置:
trunk/src/kash
檔案:
修改 4 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/kash/Makefile.kmk

    r2282 r2287  
    126126# Use the pregenerated code.
    127127#
    128 kash_ORDERDEPS :=
     128kash_INTERMEDIATES :=
    129129kash_INCS += generated
    130130kash_SOURCES := $(patsubst $(PATH_kash)/%,generated/%,$(kash_SOURCES))
  • trunk/src/kash/shinstance.c

    r2286 r2287  
    651651}
    652652
    653 int sh_sigismember(shsigset_t *setp, int signo)
     653int sh_sigismember(shsigset_t const *setp, int signo)
    654654{
    655655#ifdef _MSC_VER
     
    689689                for (rc = 0; rc < NSIG; rc++)
    690690                    if (sh_sigismember(newp, rc))
    691                         sh_sigaddset(&mask);
     691                        sh_sigaddset(&mask, rc);
    692692                break;
    693693            case SIG_UNBLOCK:
    694694                for (rc = 0; rc < NSIG; rc++)
    695695                    if (sh_sigismember(newp, rc))
    696                         sh_sigdelset(&mask);
     696                        sh_sigdelset(&mask, rc);
    697697                break;
    698698            case SIG_SETMASK:
     
    862862#  else
    863863    pid = -1;
    864     error = ENOSYS;
     864    errno = ENOSYS;
    865865#  endif
    866866# else
     
    888888# ifdef _MSC_VER
    889889    pidret = -1;
    890     error = ENOSYS;
     890    errno = ENOSYS;
    891891# else
    892892    pidret = waitpid(pid, statusp, flags);
     
    919919int sh_execve(shinstance *psh, const char *exe, const char * const *argv, const char * const *envp)
    920920{
     921#ifdef _MSC_VER
     922    intptr_t rc;
     923#else
    921924    int rc;
     925#endif
    922926
    923927#ifdef DEBUG
     
    946950    TRACE2((psh, "sh_execve -> %d [%d]\n", rc, errno));
    947951    (void)psh;
     952    return (int)rc;
     953}
     954
     955uid_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
     975uid_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
     995gid_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
     1015gid_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
     1035pid_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
     1055pid_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
     1075pid_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
     1095int 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;
    9481113    return rc;
    9491114}
    9501115
    951 uid_t sh_getuid(shinstance *psh)
    952 {
    953 #ifdef SH_PURE_STUB_MODE
    954     uid_t uid = 0;
    955 
    956 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    957 # ifdef _MSC_VER
    958     uid_t uid = 0;
    959 # else
    960     uid_t uid = getuid();
    961 # endif
    962 
    963 #else
    964 #endif
    965 
    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_MODE
    974     uid_t euid = 0;
    975 
    976 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    977 # ifdef _MSC_VER
    978     uid_t euid = 0;
    979 # else
    980     uid_t euid = geteuid();
    981 # endif
    982 
    983 #else
    984 #endif
    985 
    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_MODE
    994     gid_t gid = 0;
    995 
    996 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    997 # ifdef _MSC_VER
    998     gid_t gid = 0;
    999 # else
    1000     gid_t gid = getgid();
    1001 # endif
    1002 
    1003 #else
    1004 #endif
    1005 
    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_MODE
    1014     gid_t egid = 0;
    1015 
    1016 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    1017 # ifdef _MSC_VER
    1018     gid_t egid = 0;
    1019 # else
    1020     gid_t egid = getegid();
    1021 # endif
    1022 
    1023 #else
    1024 #endif
    1025 
    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_MODE
    1036     pid = 0;
    1037 
    1038 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    1039 # ifdef _MSC_VER
    1040     pid = _getpid();
    1041 # else
    1042     pid = getpid();
    1043 # endif
    1044 #else
    1045 #endif
    1046 
    1047     (void)psh;
    1048     return pid;
    1049 }
    1050 
    1051 pid_t sh_getpgrp(shinstance *psh)
    1052 {
    1053 #ifdef SH_PURE_STUB_MODE
    1054     pid_t pgrp = 0;
    1055 
    1056 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    1057 # ifdef _MSC_VER
    1058     pid_t pgrp _getpid();
    1059 # else
    1060     pid_t pgrp = getpgrp();
    1061 # endif
    1062 
    1063 #else
    1064 #endif
    1065 
    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_MODE
    1074     pid_t pgid = pid;
    1075 
    1076 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    1077 # ifdef _MSC_VER
    1078     pid_t pgid = pid;
    1079 # else
    1080     pid_t pgid = getpgid(pid);
    1081 # endif
    1082 
    1083 #else
    1084 #endif
    1085 
    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_MODE
    1094     int rc = -1;
    1095 
    1096 #elif defined(SH_STUB_MODE) || defined(SH_FORKED_MODE)
    1097 # ifdef _MSC_VER
    1098     int rc = -1;
    1099     error = ENOSYS;
    1100 # else
    1101     int rc = setpgid(pid, pgid);
    1102 # endif
    1103 
    1104 #else
    1105 #endif
    1106 
    1107     TRACE2((psh, "sh_setpgid(%d, %d) -> %d [%d]\n", pid, pgid, rc, errno));
    1108     (void)psh;
    1109     return rc;
    1110 }
    1111 
    11121116pid_t sh_tcgetpgrp(shinstance *psh, int fd)
    11131117{
     
    11201124# ifdef _MSC_VER
    11211125    pgrp = -1;
    1122     error = ENOSYS;
     1126    errno = ENOSYS;
    11231127# else
    11241128    pgrp = tcgetpgrp(fd);
     
    11441148# ifdef _MSC_VER
    11451149    rc = -1;
    1146     error = ENOSYS;
     1150    errno = ENOSYS;
    11471151# else
    11481152    rc = tcsetpgrp(fd, pgrp);
     
    11651169# ifdef _MSC_VER
    11661170    int rc = -1;
    1167     error = ENOSYS;
     1171    errno = ENOSYS;
    11681172# else
    11691173    int rc = getrlimit(resid, limp);
     
    11881192# ifdef _MSC_VER
    11891193    int rc = -1;
    1190     error = ENOSYS;
     1194    errno = ENOSYS;
    11911195# else
    11921196    int rc = setrlimit(resid, limp);
  • trunk/src/kash/shinstance.h

    r2286 r2287  
    342342#define SH_SIG_ERR ((shsig_t)SIG_ERR)
    343343#ifdef _MSC_VER
     344#   define SA_RESTART       0x02
    344345#   define SIG_BLOCK         1
    345346#   define SIG_UNBLOCK       2
     
    368369void sh_sigaddset(shsigset_t *, int);
    369370void sh_sigdelset(shsigset_t *, int);
    370 int sh_sigismember(shsigset_t *, int);
     371int sh_sigismember(shsigset_t const *, int);
    371372int sh_sigprocmask(shinstance *, int, shsigset_t const *, shsigset_t *);
    372373void sh_abort(shinstance *) __attribute__((__noreturn__));
  • trunk/src/kash/show.c

    r2280 r2287  
    433433                fd = shfile_open(&psh->fdtab, s, O_APPEND | O_RDWR | O_CREAT, 0600);
    434434                if (fd != -1) {
    435                         int fd2 = fcntl(fd, F_DUPFD, 199);
     435                        int fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 199);
    436436                        if (fd2 == -1)
    437                                 fd2 = fcntl(fd, F_DUPFD, 99);
     437                                fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 99);
    438438                        if (fd2 == -1)
    439                                 fd2 = fcntl(fd, F_DUPFD, 49);
     439                                fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 49);
    440440                        if (fd2 == -1)
    441                                 fd2 = fcntl(fd, F_DUPFD, 18);
     441                                fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 18);
    442442                        if (fd2 == -1)
    443                                 fd2 = fcntl(fd, F_DUPFD, 10);
     443                                fd2 = shfile_fcntl(&psh->fdtab, fd, F_DUPFD, 10);
    444444                        if (fd2 != -1) {
    445445                                close(fd);
     
    453453                }
    454454        }
    455         setvbuf(tracefile, (char *)NULL, _IOLBF, 0); //setlinebuf(tracefile);
     455        setvbuf(tracefile, (char *)NULL, _IOLBF, 1024);
    456456        fputs("\nTracing started.\n", tracefile);
    457457}
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette