What is the difference between using system() to execute a binary and using the combination of fork/execvp.
Is there any security/portablility/performance difference.
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.
System also uses a
fork/exec… combination. If you dofork/execyourself you can execute parallel to your running process, whilesystemis blocking (includes thewait). Alsosystemexecutes the command not direct, but via a shell (which makes problems with setuid bit) andsystemblocks/ignores certain signals (SIGINT, SIGCHILD, SIGQUIT).