execlp() system call error in output

后端 未结 3 417
深忆病人
深忆病人 2021-01-25 22:50

This very simple example of exec() system call. Here, I am trying to call execlp() twice. But, I am not getting excepted output. It shows output only f

3条回答
  •  情深已故
    2021-01-25 23:00

    execlp () replaces the process that called it by the process which was called.

    From this link:

    "The exec() family of functions replaces the current process image with a new process image."

    To retain both the processes, use fork().

提交回复
热议问题