how to get pid from system() call in c/c++?

W

wavelet

main()
{
system("call B");
printf("main..");
}

How can I get the process id of system call
in c/c++ language?

What I want to do is to kill that process after
sometimes later.

Thx.
 
Z

Zara

wavelet said:
main()
{
system("call B");
printf("main..");
}

How can I get the process id of system call
in c/c++ language?

What I want to do is to kill that process after
sometimes later.

All this is OS and/or implementation dependent. You should check in
comp.os. <your operating system>.

Best regards
 
M

Maxim Yegorushkin

wavelet said:
main()
{
system("call B");
printf("main..");
}

How can I get the process id of system call
in c/c++ language?

What I want to do is to kill that process after
sometimes later.

system() does not return until the process has finished. There is
nothing left to kill after the call.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top