Non-blocking version of system()

后端 未结 6 634
傲寒
傲寒 2020-12-09 03:24

I want to launch a process from within my c program, but I don\'t want to wait for that program to finish. I can launch that process OK using system() but that always waits.

6条回答
  •  失恋的感觉
    2020-12-09 03:44

    One option is in your system call, do this:

     system("ls -l &");
    

    the & at the end of the command line arguments forks the task you've launched.

提交回复
热议问题