cristiangarofalo
June 23rd, 2010, 08:45 PM
Hey Guys,
i've been back and forth with a problem That I dont' know how to resolve.
I have a program called server , i need to create an interface to stop and start this program in the background.
I need to be able to launch the process and then using that pid be able to kill it stop etc,
i need something like this:
switch (pid = fork())
{
case -1:
exit(1)
case 0:
// here I need to be able to call server(); get its pid
// and automatically continue with the execution of my program (parent)
// if its not possible I can compile server and call system(server)
// but how do I know the pid of server?
// I need the pod to be able to kill it later on the main if the customer chose "stop server"
default:
Menu();
}
any clue? advice?
Thanks!
i've been back and forth with a problem That I dont' know how to resolve.
I have a program called server , i need to create an interface to stop and start this program in the background.
I need to be able to launch the process and then using that pid be able to kill it stop etc,
i need something like this:
switch (pid = fork())
{
case -1:
exit(1)
case 0:
// here I need to be able to call server(); get its pid
// and automatically continue with the execution of my program (parent)
// if its not possible I can compile server and call system(server)
// but how do I know the pid of server?
// I need the pod to be able to kill it later on the main if the customer chose "stop server"
default:
Menu();
}
any clue? advice?
Thanks!