abort()函数

2018-04-04  本文已影响84人  星空梦想

#include

void abort(void);

DESCRIPTION

The abort() function causes abnormal program termination

unless the signal SIGABRT is caught and the signal  han-

dler  does  not  return.  If the abort() function causes

program termination, all open  streams  are  closed  and

flushed.

If the SIGABRT signal is blocked or ignored, the abort()

function will still override it.

abort()函数用于异常退出。返回一个错误代码。错误代码的缺省值是3。abort()函数导致程序非正常退出除非sigabrt信号被捕捉到,并且信号处理函数没有返回(即abort()函数给自己发送sigabrt信号),如果abort()函数导致程序终止,所有的打开的流将被关闭并且刷新

上一篇 下一篇

猜你喜欢

热点阅读