tail head cat sleep
QR code linking to this page

manページ  — ATEXIT

名称

atexit – 終了時に呼び出される関数を登録する

内容

ライブラリ

Standard C Library (libc, -lc)

書式

#include <stdlib.h>

int
atexit(void (*function)(void));

解説

atexit() 関数は、 exit(3) によるものであろうが、プログラムの main 関数からの戻りによるものであろうが プログラム終了時に、与えられた function が呼び出されるよう登録します。 登録された関数は、逆の順序で呼び出されます。 引数は渡されません。 少なくとも 32 個の関数が常に登録でき、 十分なメモリが割り当てられる限り、それを超える関数も登録できます。

戻り値

The atexit function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

エラー

[ENOMEM]
  関数をリストに追加するメモリが利用できませんでした。 関数の既存のリストは無修正です。

関連項目

exit(3)

規格

atexit() 関数は ISO/IEC 9899:1990 ("ISO C90") に適合しています。

ATEXIT (3) June 4, 1993

tail head cat sleep
QR code linking to this page


このマニュアルページサービスについてのご意見は Ben Bullock にお知らせください。 Privacy policy.

It's a UNIX system, I know this!
— Lex Murphy, Jurassic Park