Difference between raise(SIGABRT) and abort() methods

后端 未结 1 1752
隐瞒了意图╮
隐瞒了意图╮ 2021-01-18 11:00

I know that both raise(SIGABRT) and abort() methods will send a SIGABRT signal to itself. But there are some difference between those 2 functions.

相关标签:
1条回答
  • 2021-01-18 11:58

    The main difference it that abort() even ends the process if SIGABRT is ignored.

    Verbatim from man abort:

    If the SIGABRT signal is ignored, or caught by a handler that returns, the abort() function will still terminate the process. It does this by restoring the default disposition for SIGABRT and then raising the signal for a second time.

    0 讨论(0)
提交回复
热议问题