Espaços nominais
Variantes
Acções

std::signal

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

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
initializer_list(C++11)
bitset
hash(C++11)
Os operadores relacionais
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>=
Pares e tuplas
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)
Troque, avançar e avançar
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)
 
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 <csignal>
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 std::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 definida pela implementação conjunto de sinais 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 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.
Para alguns dos sinais, a implementação pode chamar std::signal(sig, SIG_IGN) na inicialização do programa. Quanto ao resto, a implementação deve chamar std::signal(sig, SIG_DFL).
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 o usuário definiu função retorna ao manusear SIGFPE, SIGILL, SIGSEGV ou qualquer sinal aplicação definida outra que especifique uma exceção computacional, o comportamento é indefinido. Na maioria das implementações o programa 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 o manipulador de sinal é chamado como resultado de std::abort ou std::raise, o comportamento é indefinido se qualquer um dos seguintes requisitos não é seguido:
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.
  • o manipulador de sinal chama 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.
  • o manipulador de sinal refere-se a um objeto de duração de armazenamento estático que não é declarado como 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.
  • o manipulador de sinal chama qualquer função dentro da biblioteca padrão, exceto std::abort, std::_Exit, std::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 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.

Í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]
C documentation for signal