on_exit(3) Library Functions Manual on_exit(3) NOMBRE on_exit - registra una funcion para ser invocada en la terminacion normal de un programa BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include int on_exit(void (*funcion)(int , void *), void *arg); Requisitos de Macros de Prueba de Caracteristicas para glibc (vease feature_test_macros(7)): on_exit(): A partir de glibc 2.19: _DEFAULT_SOURCE Anteriores a glibc 2.19: _BSD_SOURCE || _SVID_SOURCE DESCRIPCION La funcion on_exit() registra la funcion dada para ser invocada en la terminacion normal de un programa, ya sea via exit(3) o via el valor retornado por la funcion main() del programa. A la funcion se le pasa el parametro de exit(3) y el parametro arg de on_exit(). Es posible registrar la misma funcion varias veces: se invoca una vez para cada registro. 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. VALOR DEVUELTO La funcion on_exit() devuelve el valor 0 en caso de exito, o un valor distinto de cero en caso contrario. ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +-----------------------------+--------------------+-------------------+ |Interfaz | Atributo | Valor | +-----------------------------+--------------------+-------------------+ |on_exit() | Seguridad del hilo | Multi-hilo seguro | +-----------------------------+--------------------+-------------------+ ESTANDARES None. HISTORIAL 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. VEASE TAMBIEN _exit(2), atexit(3), exit(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Urko Lusa y Marcos Fouces Esta traduccion es documentacion libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algun error en la traduccion de esta pagina del manual, envie un correo electronico a . Paginas de manual de Linux 6.06 31 Octubre 2023 on_exit(3)