< prev index next >
src/hotspot/os/linux/os_linux.cpp
Print this page
*** 5718,5728 ****
// Unlike system(), this function can be called from signal handler. It
// doesn't block SIGINT et al.
int os::fork_and_exec(char* cmd) {
const char * argv[4] = {"sh", "-c", cmd, NULL};
! pid_t pid = fork();
if (pid < 0) {
// fork failed
return -1;
--- 5718,5734 ----
// Unlike system(), this function can be called from signal handler. It
// doesn't block SIGINT et al.
int os::fork_and_exec(char* cmd) {
const char * argv[4] = {"sh", "-c", cmd, NULL};
! pid_t pid ;
!
! if (OnOutOfMemoryError && OnOutOfMemoryError[0]) {
! pid = vfork();
! } else {
! pid = fork();
! }
if (pid < 0) {
// fork failed
return -1;
< prev index next >