What is exactly the difference between commands exec(const char *c) and system(const char *c) in unix based systems ?
Both can be called from a C program to execute system calls. Is there a difference b/w the two ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
execreplaces your process with the specified program. Your program is done, and will not continue running.spawnstarts a new process (probably by first usingfork), and runs the specified program while your program continues executing.systemstarts a new process (probably by first usingfork), and runs the specified program while your program waits. Once the child exits, your program continues.