std::signal
De cppreference.com
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Déclaré dans l'en-tête <csignal> | ||
void(*signal(int sig, void(*handler)(int)))(int); | ||
Définit le gestionnaire d'erreurs pour
sig
signal. Le gestionnaire de signal peut être réglé de sorte que la gestion par défaut se produira, le signal est ignoré, ou une fonction définie par l'utilisateur est appelé .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.
You can help to correct and verify the translation. Click here for instructions.
Quand gestionnaire de signal est définie sur une fonction et un signal se produit, il est défini par l'implémentation si std::signal(sig, SIG_DFL) sera exécutée immédiatement avant le début de gestionnaire de signal. En outre, la mise en œuvre peut prévenir certains définie par l'implémentation ensemble de signaux de se produire alors que le gestionnaire de signal fonctionne .
Original:
When signal handler is set to a function and a signal occurs, it is implementation defined whether std::signal(sig, SIG_DFL) will be executed immediately before the start of signal handler. Also, the implementation can prevent some implementation-defined set of 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.
You can help to correct and verify the translation. Click here for instructions.
Pour certains de ces signaux, la mise en œuvre peut appeler std::signal(sig, SIG_IGN) au démarrage du programme. Pour le reste, la mise en œuvre doit std::signal(sig, SIG_DFL) appeler .
Original:
For some of the signals, the implementation may call std::signal(sig, SIG_IGN) at the startup of the program. For the rest, the implementation must call std::signal(sig, SIG_DFL).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Si l'utilisateur défini fonction retourne lors de la manipulation
SIGFPE
, SIGILL
, SIGSEGV
ou toute autre définition de l'implémentation signal indiquant une exception calcul, le comportement est indéfini. Dans la plupart des implémentations, le programme se termine . Original:
If the user defined function returns when handling
SIGFPE
, SIGILL
, SIGSEGV
or any other implementation-defined signal specifying a computational exception, 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.
You can help to correct and verify the translation. Click here for instructions.
Si le gestionnaire de signal est appelé à la suite de std::abort ou std::raise, le comportement est indéfini si l'une des conditions suivantes n'est pas respectée:
Original:
If the signal handler is called as a result of std::abort or std::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.
You can help to correct and verify the translation. Click here for instructions.
- le handler de signal appelle std::raise .Original:the signal handler calls std::raise.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - le gestionnaire de signal se réfère à un objet de la durée de stockage statique qui n'est pas déclarée comme volatilestd::sig_atomic_t .Original:the signal handler refers to an object of static storage duration which is not declared as volatilestd::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. - le gestionnaire de signaux appelle une fonction dans la bibliothèque standard, sauf std::abort, std::_Exit, ou std::signal avec le premier argument n'est pas le numéro du signal actuellement traitée .Original:the signal handler calls any function within the standard library, except std::abort, std::_Exit, or std::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.
Sommaire |
[modifier]Paramètres
sig | - | le signal de définir le gestionnaire de signal. Elle peut être mise en oeuvre définie par une valeur ou une des valeurs suivantes:
Original: the signal to set the signal handler to. It can be an implementation-defined value or one of the following values:
The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||
handler | - | le gestionnaire de signal. Ce doit être l'un des suivants:
Original: the signal handler. This must be one of the following:
The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifier]Retourne la valeur
Gestionnaire de signal précédent sur le succès ou l'échec sur
SIG_ERR
(création d'un gestionnaire de signal peut être désactivée sur certaines implémentations) .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.
You can help to correct and verify the translation. Click here for instructions.
[modifier]Exemple
This section is incomplete Reason: no example |
[modifier]Voir aussi
exécute le gestionnaire de signal pour un signal particulier 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. (fonction) | |
C documentation for signal |