std::signal

Da cppreference.com.
< cpp‎ | utility‎ | program

 
 
Utilità libreria
Tipo di supporto (basic types, RTTI, type traits)
Gestione della memoria dinamica
La gestione degli errori
Programma di utilità
Funzioni variadic
Data e ora
Funzione oggetti
initializer_list(C++11)
bitset
hash(C++11)
Gli operatori relazionali
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Coppie e tuple
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Swap, in avanti e spostare
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
Programma di supporto utilità
Programma di terminazione
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.
Comunicante con l'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.
Segnali
Original:
Signals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipi di segnale
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.
SIGABRT
SIGFPE
SIGILL
SIGINT
SIGSEGV
SIGTERM
Non locali salti
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.
setjmp
longjmp
Tipi
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
jmp_buf
 
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.
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.
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.
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.
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.
  • 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:
definisce i tipi di segnale
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.

(macro costante)[modifica]
Original:
the signal to set the signal handler to. It can be an implementation-defined value or one of the following values:
definisce i tipi di segnale
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.

(macro costante)[modifica]
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:
  • SIG_DFL macro. Il gestore del segnale è impostata gestore predefinito del segnale.
  • SIG_IGN macro. Il segnale viene ignorato.
  • Puntatore a una funzione. La firma della funzione deve essere equivalente al seguente:
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.

[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.

[modifica]Esempio

[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)[modifica]
C documentation for signal
close