on_exit(3) Library Functions Manual on_exit(3) JMENO on_exit - registruje funkci, ktera se ma vyvolat pri ukonceni procesu KNIHOVNA Standardni knihovna C (libc, -lc) POUZITI #include int on_exit(void (*function)(int, void *), void *arg); Pozaduje mnozinu testovacich maker pro glibc (viz feature_test_macros(7)): on_exit(): Od glibc 2.19: _DEFAULT_SOURCE glibc 2.19 a drivejsi: _BSD_SOURCE || _SVID_SOURCE POPIS The on_exit() function registers the given function to be called at normal process termination, whether via exit(3) or via return from the program's main(). The function is passed the status argument given to the last call to exit(3) and the arg argument from on_exit(). The same function may be registered multiple times: it is called once for each registration. When a child process is created via fork(2), it inherits copies of its parent's registrations. Upon a successful call to one of the exec(3) functions, all registrations are removed. NAVRATOVE HODNOTY Funkce on_exit() vraci hodnotu 0, byla-li uspesna, jinak vraci nenulovou hodnotu. ATRIBUTY Vysvetleni pojmu pouzitych v teto casti viz attributes(7). +-----------------------------------+------------------------+---------+ |Rozhrani | Atribut | Hodnota | +-----------------------------------+------------------------+---------+ |on_exit() | Zabezpeceni vlaken | MT-Safe | +-----------------------------------+------------------------+---------+ STANDARDY None. HISTORIE SunOS 4, glibc. Removed in Solaris (SunOS 5). Use the standard atexit(3) instead. CAVEATS By the time function is executed, stack (auto) variables may already have gone out of scope. Therefore, arg should not be a pointer to a stack variable; it may however be a pointer to a heap variable or a global variable. DALSI INFORMACE _exit(2), atexit(3), exit(3) PREKLAD Preklad teto prirucky do cestiny vytvorili Pavel Heimlich Tento preklad je bezplatna dokumentace; Prectete si GNU General Public License Version 3 nebo novejsi ohledne podminek autorskych prav. Neexistuje ZADNA ODPOVEDNOST. Pokud narazite na nejake chyby v prekladu teto prirucky, poslete e-mail na adresu . Linux man-pages 6.9.1 2. kvetna 2024 on_exit(3)