![]() |
1
6
从
POSIX specification for
因此,为了正确响应信号,需要检查
如果你运行它,你会得到: $ ./sys Exited normally with status 0 Exited normally with status 0 Exited normally with status 0 Exited normally with status 0 Exited normally with status 0 Exited normally with status 0 ^CExited with signal 2 |
![]() |
2
2
IEEE Std 1003.1-2008 (POSIX) :
|
![]() |
3
1
根据圣哈辛托的上述评论: system()本质上是分叉、阻塞父级,并忽略子级中的某些信号,如POSIX规范链接所示。您可以先为system()创建另一个要阻止的进程来绕过此操作。这使得原始进程(shell所运行的进程的祖辈)可以自由地接受kill信号。
表面上看,这似乎是我需要的。 |
![]() |
MaPo · Linux,设置锁定ICMP_过滤器选项 5 月前 |
![]() |
user2138149 · 双栈网络服务器无法按预期处理ipv4请求 5 月前 |
![]() |
Marco · PyCharm Linux系统文件上os.stat异常 6 月前 |