[omniORB] system() under omniORB4

Duncan Grisby duncan@grisby.org
Wed Oct 9 22:14:01 2002


On Wednesday 9 October, Mike Mascari wrote:

> I have a server which, under omniORB3, invoked system() to 
> execute a shell command. Under omniORB4, however, the server 
> dies instantly..at least the thread invoking system() does. Is 
> system() prohibited under omniORB4 and if so, how can I achieve 
> the same results?

Make sure you explicitly link with libpthread. That might fix it.

Either way, the safest way to fork from a multi-threaded program is to
pre-fork a process listening on a pipe before the main program starts
any threads. Only do the system() call from the child process, which
remains single threaded.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --