std::signal
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <csignal> | ||
void(*signal(int sig, void(*handler)(int)))(int); | ||
Consente di impostare il gestore degli errori per
sig
segnale. Il gestore del segnale può essere impostato in modo che la gestione di default si verificherà, il segnale viene ignorato, o una funzione definita dall'utente viene chiamato.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.
Quando gestore di segnale viene impostata su una funzione e un segnale di verifica, è definito se attuazione std::signal(sig, SIG_DFL) verrà eseguita immediatamente prima dell'inizio del gestore di segnale. Inoltre, l'implementazione può prevenire alcuni implementazione definita serie di segnali che si verificano mentre il gestore di segnale viene eseguito.
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.
Per alcuni dei segnali, l'applicazione può chiamare std::signal(sig, SIG_IGN) all'avvio del programma. Per il resto, l'implementazione deve std::signal(sig, SIG_DFL) chiamare.
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.
Se l'utente definito funzione ritorna quando si maneggia
SIGFPE
, SIGILL
, SIGSEGV
o qualsiasi altra implementazione definita segnale specificando un'eccezione computazionale, il comportamento è indefinito. Nella maggior parte delle implementazioni il programma termina. 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.
Se il gestore di segnale è chiamato a seguito di std::abort o std::raise, il comportamento è indefinito se uno dei seguenti requisiti non è seguita:
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.
- il gestore di segnale chiama 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. - il gestore di segnale si riferisce ad un oggetto di durata di conservazione statica che non è dichiarata come 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. - il gestore di segnale chiama qualsiasi funzione all'interno della libreria standard, ad eccezione std::abort, std::_Exit o std::signal con il primo argomento non è il numero del segnale attualmente gestito.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.
Indice |
[modifica]Parametri
sig | - | il segnale per impostare il gestore di segnale. Può essere un'implementazione valore definito o uno dei seguenti valori:
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 | - | il segnale gestore. Questo deve essere uno dei seguenti:
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. |
[modifica]Valore di ritorno
Gestore di segnale precedente in caso di successo o
SIG_ERR
in caso di fallimento (la fissazione di un gestore di segnale può essere disattivato in alcune implementazioni).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.
[modifica]Esempio
This section is incomplete Reason: no example |
[modifica]Vedi anche
esegue il gestore di segnale per il segnale particolare 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. (funzione) | |
C documentation for signal |