Espaços nominais
Variantes
Acções

signal

Da cppreference.com
< c‎ | program

 
 
Utilitários de apoio do programa
Término do programa
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.
abort
exit
quick_exit(C++11)
_Exit(C++11)
Comunicando com o meio 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.
Sinais
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 sinais
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
Não-locais 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.
setjmp
longjmp
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.
jmp_buf
 
Defined in header <signal.h>
void (*signal( int sig, void (*handler) (int))) (int);
Define o manipulador de erro para sig sinal. O manipulador de sinal pode ser definido de modo que o tratamento padrão irá ocorrer, o sinal é ignorado, ou uma função definida pelo usuário é chamado.
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 manipulador de sinal é definida como uma função e um sinal ocorre, é definido se signal(sig, SIG_DFL) implementação será executada imediatamente antes do início do tratador de sinal. Além disso, a execução pode prevenir alguns sinais de aplicação definida conjunto af ocorra enquanto o manipulador de sinal é executado.
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.
Se o usuário definiu função retorna ao manusear SIGFPE, SIGILL ou SIGSEGV, o comportamento é indefinido. Na maioria das implementações o 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.
Se o manipulador de sinal é chamado como resultado de abort ou raise, o comportamento é indefinido se qualquer um dos seguintes requisitos não é seguido:
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.
  • o manipulador de sinal chama 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.
  • o manipulador de sinal refere-se a um objeto de duração de armazenamento estático que não é declarado 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.
  • o manipulador de sinal chama qualquer função dentro da biblioteca padrão, exceto abort, _Exit, signal ou com o primeiro argumento não é o número do sinal atualmente tratado.
    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.

Índice

[editar] Parâmetros

sig -
o sinal para estabelecer o manipulador de sinal. Ele pode ser um valor definido de implementação ou um dos valores seguintes:
define os tipos de sinal
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 constante) [edit]
Original:
the signal to set the signal handler to. It can be an implementation-defined value or one of the following values:
define os tipos de sinal
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 constante) [edit]
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
handler -
o manipulador de sinal. Este deve ser um dos seguintes:
  • SIG_DFL macro. O manipulador de sinal é definida como manipulador de sinal padrão.
  • SIG_IGN macro. O sinal é ignorado.
  • Ponteiro para uma função. A assinatura da função deve ser equivalente ao seguinte:
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

Manipulador de sinal anterior sobre o sucesso ou o fracasso na SIG_ERR (definindo um manipulador de sinal pode ser desativado em algumas implementações).
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] Exemplo

[editar] Veja também

executa o manipulador de sinal para sinal em 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.

(função) [edit]