◐ Shell
clean mode source ↗

std::signal - cppreference.com

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.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

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 volatile std::sig_atomic_t.

    Original:

    the signal handler refers to an object of static storage duration which is not declared as volatile std::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.

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:

  • 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:

<tbody> </tbody>

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:

<tbody> </tbody>

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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.

Esempio

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]