replace system() with non-blocking function

前端 未结 5 1539
别那么骄傲
别那么骄傲 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:36

    If in windows, use the ShellExecute() function from the Windows API.

    If in Unix, go for fork() then system() as mentioned.

提交回复
热议问题