Espacios de nombres
Variantes
Acciones

signal

De cppreference.com
< c‎ | program
 
 
Servicios públicos de apoyo a programas
Programa terminación
Original:
Program termination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
La comunicación con el medio ambiente
Original:
Communicating with the environment
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Señales
Original:
Signals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos de señal
Original:
Signal types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
No locales saltos
Original:
Non-local jumps
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido en el archivo de encabezado <signal.h>
void (*signal( int sig, void (*handler) (int))) (int);
Establece el gestor de errores para sig señal. El manejador de la señal puede ajustarse de manera que el manejo de defecto se producirá, señal se ignora, o una función definida por el usuario llamado está .
Original:
Sets the error handler for signal sig. The signal handler can be set so that default handling will occur, signal is ignored, or an user-defined function is called.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cuando manejador de la señal se define como una función y se produce una señal, que depende de la implementación si signal(sig, SIG_DFL) se ejecutará inmediatamente antes del inicio del controlador de señal. Además, la aplicación puede prevenir algunas señales definido por la implantación de ajuste af ocurra mientras se ejecuta el manejador de la señal .
Original:
When signal handler is set to a function and a signal occurs, it is implementation defined whether signal(sig, SIG_DFL) will be executed immediately before the start of signal handler. Also, the implementation can prevent some implementation-defined set af signals from occurring while the signal handler runs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si el usuario devuelve la función definida al manipular SIGFPE, SIGILL o SIGSEGV, el comportamiento no está definido. En la mayoría de las implementaciones del programa termina .
Original:
If the user defined function returns when handling SIGFPE, SIGILL or SIGSEGV, the behavior is undefined. In most implementations the program terminates.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Si el manejador de la señal se llama como resultado de abort o raise, el comportamiento no está definido si alguno de los siguientes requisitos no se cumple:
Original:
If the signal handler is called as a result of abort or raise, the behavior is undefined if any of the following requirements is not followed:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • el manejador de la señal llama raise .
    Original:
    the signal handler calls raise.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • el manejador de señal se refiere a un objeto de la duración de almacenamiento estático que no se declara como volatile sig_atomic_t .
    Original:
    the signal handler refers to an object of static storage duration which is not declared as volatile sig_atomic_t.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • el manejador de la señal llama a cualquier función dentro de la biblioteca estándar, excepto abort, _Exit o signal con el primer argumento no es el número de la señal actualmente manejan .
    Original:
    the signal handler calls any function within the standard library, except abort, _Exit, or signal with the first argument not being the number of the signal currently handled.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Parámetros

sig -
la señal para establecer el manejador de señales para. Puede ser una aplicación definida por el valor o uno de los valores siguientes:
define los tipos de señales
Original:
defines signal types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(constante de macro) [editar]
Original:
the signal to set the signal handler to. It can be an implementation-defined value or one of the following values:
define los tipos de señales
Original:
defines signal types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(constante de macro) [editar]
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
handler -
el manejador de señales. Este debe ser uno de los siguientes:
  • SIG_DFL macro. El manejador de la señal se fija a gestor por defecto de la señal.
  • SIG_IGN macro. La señal se ignora.
  • Puntero a una función. La firma de la función debe ser equivalente a la siguiente:
void fun(int sig);
Original:
the signal handler. This must be one of the following:
  • SIG_DFL macro. The signal handler is set to default signal handler.
  • SIG_IGN macro. The signal is ignored.
  • pointer to a function. The signature of the function must be equivalent to the following:
void fun(int sig);
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

Manejador de la señal anterior en el éxito o en el fracaso SIG_ERR (establecer un manejador de la señal puede desactivarse en algunas implementaciones) .
Original:
Previous signal handler on success or SIG_ERR on failure (setting a signal handler can be disabled on some implementations).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

[editar] Ver también

ejecuta el manejador de señal para señal particular
Original:
runs the signal handler for particular signal
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [editar]