.\" -*- coding: UTF-8 -*- .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified 1993-04-02, David Metcalfe .\" Modified 1993-07-25, Rik Faith (faith@cs.unc.edu) .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH ON_EXIT 3 "2 Agosto 2019" GNU "Manual del Programador de Linux" .SH NOMBRE on_exit \- registra una función para ser invocada en la terminación normal de un programa .SH SINOPSIS .nf \fB#include \fP .PP \fBint on_exit(void (*\fP\fIfunction\fP\fB)(int , void *), void *\fP\fIparam\fP\fB);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBon_exit\fP(): Since glibc 2.19: _DEFAULT_SOURCE Glibc 2.19 and earlier: _BSD_SOURCE || _SVID_SOURCE .SH DESCRIPCIÓN The \fBon_exit\fP() function registers the given \fIfunction\fP to be called at normal process termination, whether via \fBexit\fP(3) or via return from the program's \fImain\fP(). The \fIfunction\fP is passed the status argument given to the last call to \fBexit\fP(3) and the \fIarg\fP argument from \fBon_exit\fP(). .PP The same function may be registered multiple times: it is called once for each registration. .PP When a child process is created via \fBfork\fP(2), it inherits copies of its parent's registrations. Upon a successful call to one of the \fBexec\fP(3) functions, all registrations are removed. .SH "VALOR DEVUELTO" La función \fBon_exit\fP() devuelve el valor 0 en caso de éxito, o un valor distinto de cero en caso contrario. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaz Atributo Valor T{ \fBon_exit\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH "CONFORME A" This function comes from SunOS 4, but is also present in glibc. It no longer occurs in Solaris (SunOS 5). Portable application should avoid this function, and use the standard \fBatexit\fP(3) instead. .SH NOTAS By the time \fIfunction\fP is executed, stack (\fIauto\fP) variables may already have gone out of scope. Therefore, \fIarg\fP should not be a pointer to a stack variable; it may however be a pointer to a heap variable or a global variable. .SH "VÉASE TAMBIÉN" \fB_exit\fP(2), \fBatexit\fP(3), \fBexit\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Urko Lusa . Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org>. .ME .