Hello there. Is there someone kind enough to please explain to me the difference of using fork() and exec() with system() in invoking a process. I just want to know their difference according to well experienced with processes here. And what is the most efficient in invoking a process between the two. Thanks.
jaepi
22
Practically a Master Poster
Recommended Answers
Jump to Post> It executed two "su" commands.
Yes it will (as written). After fork() returns, then you have two processes doing exactly the same thing (for a short while at least usually).
Mostly, it works like thispid = fork(); if ( pid == 0 ) { // …
All 6 Replies
jaepi
22
Practically a Master Poster
Salem
5,138
Posting Sage
jaepi
22
Practically a Master Poster
DeepakHemnani
0
Newbie Poster
DeepakHemnani
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.