mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
use vfork instead of fork on QNX
On QNX, fork cannot be used in multithreaded programs, but vfork can, so that's what we'll use. http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html
This commit is contained in:
parent
4237a19b68
commit
cace9d4531
@ -402,7 +402,16 @@ Java_java_lang_Runtime_exec(JNIEnv* e, jclass,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __QNX__
|
||||||
|
// fork(2) doesn't work in multithreaded QNX programs. See
|
||||||
|
// http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html
|
||||||
|
pid_t pid = vfork();
|
||||||
|
#else
|
||||||
|
// We might be able to just use vfork on all UNIX-style systems, but
|
||||||
|
// the manual makes it sound dangerous due to the shared
|
||||||
|
// parent/child address space, so we use fork if we can.
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
|
#endif
|
||||||
switch(pid){
|
switch(pid){
|
||||||
case -1: // error
|
case -1: // error
|
||||||
throwNewErrno(e, "java/io/IOException");
|
throwNewErrno(e, "java/io/IOException");
|
||||||
|
Loading…
Reference in New Issue
Block a user