0
debuggerProcess = new ACE_Process();
ACE_Process_Options options;
options.command_line(cmdline.c_str());
//options.avoid_zombies(1);
pid_t pid = debuggerProcess->spawn(options);

ACE_Process_Options::spawn() is working properly on windows. if i pass the invalid input which means a non-existent executable, return pid should be "-1". whereas in linux, it is not the same and return pid is some +ve Number(>1). i checked the created process as well, that was a zombie process. if i specify to avoid_zombies the return pid is always "1". can you please tell when this call fail n returns "-1" in Linux.

Santhosh Kumar
  • 167
  • 2
  • 12
  • Have you tried to check for a valid pid by comparing wiht ACE_INVALID_PID? – Johnny Willemsen Nov 11 '15 at 10:57
  • yes.. i compared with valid pid. I debugged ACE_Process::spawn(), inside they create a new process using fork() & returning the return status of fork() which is >0 for parent and 0 for child process. inside the child process block they are calling ACE_OS::execvp() - this is where actual process will start, but they are not returning the exit status of execvp() call if it fails. simply they return exit status of fork().. that is why i am getting >0 for invalid process also.. – Santhosh Kumar Nov 11 '15 at 16:55
  • is there any way to know that `ACE_Process::spawn()` fails, other than the return status of `spawn()` ?? – Santhosh Kumar Nov 12 '15 at 04:20

0 Answers0