“如何流产”在不支持C中信号的平台上实施?
C中的中止
函数应该引起sigabrt
信号。但是,如果基础平台不支持sigabrt
信号,或者根本不支持信号,例如,当C移植到某些不符合Posix的OS时。在这种情况下,实施者应该做什么?
The abort
function in C is supposed to raise a SIGABRT
signal. But what if the underlying platform does not support the SIGABRT
signal or does not support signals at all, for example, when C is ported to some non-Posix-compliant OSes. In this case, what should the implementer do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上很简单。在这种情况下,C运行时的实现者需要确保在没有OS的帮助的情况下将
sigabrt
传递到signal
。它纯粹是在一个过程中。Fairly simple, in fact. In that case, the implementer of the C runtime needs to make sure that
SIGABRT
is delivered tosignal
, without help from the OS. It's purely inside a single process.