Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,调用exit(100)会以状态 100 退出应用程序,调用会raise(SIGABRT)在创建核心转储时以状态 134 中止应用程序。但是,如果我想要状态为 100 或任何其他任意值的核心转储怎么办。我怎样才能做到这一点 ?我知道有几个信号会触发核心转储,但它们似乎具有固定的退出状态。
exit(100)
raise(SIGABRT)
Looks like 134 equals to (128+6) and euqals to ((1<<7) | 6) (where #define SIGABRT 6) Co-incidence?
134
(128+6)
((1<<7) | 6)
#define SIGABRT 6
好吧,我想你可以fork()让父母打电话_exit(100),孩子打电话abort()......
fork()
_exit(100)
abort()
我同意评论说这是一个坏主意,虽然。