#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:54+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man3/atexit.3:33 #, no-wrap msgid "ATEXIT" msgstr "" #. type: TH #: man-pages/man3/atexit.3:33 #, no-wrap msgid "2008-12-05" msgstr "" #. type: TH #: man-pages/man3/atexit.3:33 #, no-wrap msgid "Linux" msgstr "" #. type: TH #: man-pages/man3/atexit.3:33 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man3/atexit.3:34 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:36 msgid "" "atexit - register a function to be called at normal process termination" msgstr "" #. type: SH #: man-pages/man3/atexit.3:36 #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:39 #, no-wrap msgid "B<#include Estdlib.hE>\n" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:41 #, no-wrap msgid "BIB<)(void));>\n" msgstr "" #. type: SH #: man-pages/man3/atexit.3:42 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:54 msgid "" "The B() function registers the given I to be called at " "normal process termination, either via B(3) or via return from the " "program's I
(). Functions so registered are called in the reverse " "order of their registration; no arguments are passed." msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:57 msgid "" "The same function may be registered multiple times: it is called once for " "each registration." msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:63 msgid "" "POSIX.1-2001 requires that an implementation allow at least B " "(32) such functions to be registered. The actual limit supported by an " "implementation can be obtained using B(3)." msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:71 msgid "" "When a child process is created via B(2), it inherits copies of its " "parent's registrations. Upon a successful call to one of the B(3) " "functions, all registrations are removed." msgstr "" #. type: SH #: man-pages/man3/atexit.3:71 #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:76 msgid "" "The B() function returns the value 0 if successful; otherwise it " "returns a nonzero value." msgstr "" #. type: SH #: man-pages/man3/atexit.3:76 #, no-wrap msgid "CONFORMING TO" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:78 msgid "SVr4, 4.3BSD, C89, C99, POSIX.1-2001." msgstr "" #. type: SH #: man-pages/man3/atexit.3:78 #, no-wrap msgid "NOTES" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:85 msgid "" "Functions registered using B() (and B(3)) are not called " "if a process terminates abnormally because of the delivery of a signal." msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:92 msgid "" "If one of the functions registered functions calls B<_exit>(2), then any " "remaining functions are not invoked, and the other process termination steps " "performed by B(3) are not performed." msgstr "" #. This can happen on OpenBSD 4.2 for example, and is documented #. as occurring on FreeBSD as well. #. Glibc does "the Right Thing" -- invocation of the remaining #. exit handlers carries on as normal. #. type: Plain text #: man-pages/man3/atexit.3:109 msgid "" "POSIX.1-2001 says that the result of calling B(3) more than once (i.e." ", calling B(3) within a function registered using B()) is " "undefined. On some systems (but not Linux), this can result in an infinite " "recursion; portable programs should not invoke B(3) inside a function " "registered using B()." msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:118 msgid "" "The B() and B(3) functions register functions on the same " "list: at normal process termination, the registered functions are invoked in " "reverse order of their registration by these two functions." msgstr "" #. In glibc, things seem to be handled okay #. type: Plain text #: man-pages/man3/atexit.3:124 msgid "" "POSIX.1-2001 says that the result is undefined if B(3) is used to " "terminate execution of one of the functions registered B()." msgstr "" #. type: SS #: man-pages/man3/atexit.3:124 #, no-wrap msgid "Linux notes" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:131 msgid "" "Since glibc 2.2.3, B() (and B(3)) can be used within a " "shared library to establish functions that are called when the shared " "library is unloaded." msgstr "" #. type: SH #: man-pages/man3/atexit.3:131 #, no-wrap msgid "EXAMPLE" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:136 #, no-wrap msgid "" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:142 #, no-wrap msgid "void\n" "bye(void)\n" "{\n" " printf(\"That was all, folks\\en\");\n" "}\n" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:148 #, no-wrap msgid "int\n" "main(void)\n" "{\n" " long a;\n" " int i;\n" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:151 #, no-wrap msgid "" " a = sysconf(_SC_ATEXIT_MAX);\n" " printf(\"ATEXIT_MAX = %ld\\en\", a);\n" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:157 #, no-wrap msgid "" " i = atexit(bye);\n" " if (i != 0) {\n" " fprintf(stderr, \"cannot set exit function\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:160 #, no-wrap msgid " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: SH #: man-pages/man3/atexit.3:161 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:165 msgid "B<_exit>(2), B(3), B(3)" msgstr "" #. type: SH #: man-pages/man3/atexit.3:165 #, no-wrap msgid "COLOPHON" msgstr "" #. type: Plain text #: man-pages/man3/atexit.3:173 msgid "" "This page is part of release 3.70 of the Linux I project. A " "description of the project, information about reporting bugs, and the latest " "version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/" "." msgstr ""