Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 1997 10:54:08 -0700
From:      Lance <lancez@accessld.com>
To:        freebsd-questions@freebsd.org
Subject:   Replace system() with fork() and exec() ?
Message-ID:  <2.2.16.19970220111650.ee6f68bc@accessld.com>

next in thread | raw e-mail | index | archive | help
Hi, there:

I have a process which executes different user programs depending on
the given parameters. Right now I am using system() to start those
user programs. I am thinking about replaing system() with fork() and
exec() (or its variants.), so it would be more fast and efficient. 
And I'd like to keep MY process running all the time. 

What's the general way to do this? Where to call exec(), in my parent
process or the child one? Could I just fork a child, call exec(), and
then exits, while the parent process is still running, or, I could let
the child does all this stuff, and let parent process dies? 

There are six different exec() functions. Which one is best to use in
this case?



Appreciate your reply!


lance

lancez@accessld.com
 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2.2.16.19970220111650.ee6f68bc>