Provided by: manpages-cs-dev_4.27.0-1_all bug

JMÉNO

       on_exit - registruje funkci, která se má vyvolat při ukončení procesu

KNIHOVNA

       Standardní knihovna C (libc, -lc)

POUŽITÍ

       #include <stdlib.h>

       int on_exit(void (*function)(int, void *), void *arg);

   Požaduje množinu testovacích maker pro glibc (viz feature_test_macros(7)):

       on_exit():
           Od glibc 2.19:
               _DEFAULT_SOURCE
           glibc 2.19 a dřívější:
               _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.

NÁVRATOVÉ HODNOTY

       Funkce on_exit() vrací hodnotu 0, byla-li úspěšná, jinak vrací nenulovou hodnotu.

ATRIBUTY

       Vysvětlení pojmů použitých v této části viz attributes(7).
       ┌────────────────────────────────────────────────────────────────────────┬────────────────────┬─────────┐
       │ RozhraníAtributHodnota │
       ├────────────────────────────────────────────────────────────────────────┼────────────────────┼─────────┤
       │ on_exit()                                                              │ Zabezpečení vláken │ 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.

DALŠÍ INFORMACE

       _exit(2), atexit(3), exit(3)

PŘEKLAD

       Překlad této příručky do češtiny vytvořili Pavel Heimlich <tropikhajma@gmail.com>

       Tento  překlad  je  bezplatná  dokumentace; Přečtěte si GNU General Public License Version 3 nebo novější
       ohledně podmínek autorských práv. Neexistuje ŽÁDNÁ ODPOVĚDNOST.

       Pokud narazíte na nějaké chyby v překladu této  příručky,  pošlete  e-mail  na  adresu  translation-team-
       cs@lists.sourceforge.net.

Linux man-pages 6.9.1                            2. května 2024                                       on_exit(3)