program stops after execvp( command.argv[0], command.argv)

后端 未结 3 650
闹比i
闹比i 2021-01-23 23:55

I am writing a small shell program that takes a command and executes it. If the user enters a not valid command the if statement returns a -1. If the command is correct it exe

3条回答
  •  渐次进展
    2021-01-24 00:30

    From the documentation on exec

    The exec() family of functions replaces the current process image with a new process image. The functions described in this manual page are front-ends for execve(2). (See the manual page for > execve(2) for further details about the replacement of the current process image.)

    If you want your process to continue, this is not the function you want to use.

提交回复
热议问题