replace system() with non-blocking function

前端 未结 5 1523
别那么骄傲
别那么骄傲 2020-12-11 06:07

I don\'t want to use system() in my C program, because system(3) blocks and this is not what I want. What is the optimal way to do it?

5条回答
  •  感情败类
    2020-12-11 06:55

    Use fork() to create a new process and then use system() (or any exec function) in it. The original process will then be able to continue executing.

提交回复
热议问题