Skip to content
Snippets Groups Projects
Commit 04c34cb1 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

now handles the absence of fork()

Rev: lib/modules/Process.pmod:1.13
parent c66b5095
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,11 @@ varargs int spawn(string s,object stdin,object stdout,object stderr, ...@@ -26,7 +26,11 @@ varargs int spawn(string s,object stdin,object stdout,object stderr,
{ {
int pid; int pid;
#if constant(fork)
pid=fork(); pid=fork();
#else
pid=-1;
#endif
if(pid==-1) if(pid==-1)
error("No more processes.\n"); error("No more processes.\n");
...@@ -81,6 +85,7 @@ string popen(string s) ...@@ -81,6 +85,7 @@ string popen(string s)
return t; return t;
} }
#if constant(fork)
void system(string s) void system(string s)
{ {
object p; object p;
...@@ -109,12 +114,15 @@ void system(string s) ...@@ -109,12 +114,15 @@ void system(string s)
exit(69); exit(69);
} }
} }
constant fork = predef::fork;
constant exece = predef::exece;
constant fork = predef::fork;
#endif
#if constant(exece)
constant exece = predef::exece;
#endif
#if constant(fork)
class Spawn class Spawn
{ {
object stdin; object stdin;
...@@ -225,3 +233,4 @@ class Spawn ...@@ -225,3 +233,4 @@ class Spawn
// int result(); // int result();
// array rusage(); // array rusage();
} }
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment