| | 3838 | | forkexec(flags, name, argv, nenv, env, inst, hosttotal, outof, tpp) |
| | 3839 | | int flags; |
| | 3840 | | char *name; |
| | 3841 | | char **argv; |
| | 3842 | | int nenv; |
| | 3843 | | char **env; |
| | 3844 | | int inst; |
| | 3845 | | int hosttotal; |
| | 3846 | | int outof; |
| | 3847 | | struct task **tpp; |
| | 3848 | | { |
| | | | ... |
| | 3861 | | char buf[32]; |
| | 3862 | | #ifdef IMA_BEOSCYLD |
| | 3863 | | int node; |
| | 3864 | | #endif |
| | 3865 | | |
| | 3866 | | static char *nullep[] = { "", 0 }; |
| | 3867 | | #ifndef IMA_OS2 |
| | 3868 | | static int nextfakepid = 10000000; |
| | 3869 | | #endif |
| | 3870 | | |
| | 3871 | | if ((tid = tid_new()) < 0) { |
| | 3872 | | pvmlogerror("forkexec() out of tids?\n"); |
| | 3873 | | return PvmOutOfRes;
|
| | 3874 | | } |
| | 3875 | | if ((tp = task_new(tid)) == NULL) {
|
| | 3876 | | pvmlogerror("forkexec() too many tasks?\n"); |
| | 3877 | | return PvmOutOfRes;
|
| | 3878 | | } |
| | 3879 | | |
| | 3880 | | |
| | 3881 | | |
| | 3882 | | eplist = CINDEX(name, '/') ? nullep : epaths;
|
| | 3883 | | |
| | 3884 | | for (ep = eplist; *ep; ep++) { |
| | 3885 | | (void)strcpy(path, *ep); |
| | 3886 | | if (path[0]) |
| | 3887 | | (void)strcat(path, "/"); |
| | 3888 | | (void)strncat(path, name, sizeof(path) - strlen(path) - 1); |
| | 3889 | | #ifdef IMA_OS2 |
| | 3890 | | (void)strcat(path,".exe"); |
| | 3891 | | #endif |
| | 3892 | | #ifdef IMA_BEOSCYLD |
| | 3893 | | |
| | 3894 | | node = bproc_currnode(); |
| | 3895 | | |
| | 3896 | | |
| | 3897 | | |
| | 3898 | | |
| | 3899 | | |
| | 3900 | | |
| | 3901 | | |
| | 3902 | | |
| | 3903 | | if(node == BPROC_NODE_MASTER) |
| | 3904 | | #endif |
| | 3905 | | if (stat(path, &sb) == -1 |
| | 3906 | | || ((sb.st_mode & S_IFMT) != S_IFREG)
|
| | 3907 | | || !(sb.st_mode & S_IEXEC)) {
|
| | 3908 | | if (pvmdebmask & PDMTASK) {
|
| | 3909 | | pvmlogprintf("forkexec() stat failed <%s>\n", path); |
| | 3910 | | } |
| | 3911 | | continue; |
| | 3912 | | } |
| | 3913 | | |
| | 3914 | | if (taskertid) { |