Linux x86_64E/S assíncrona & eventos#286
timerfd_settime
Arma, reconfigura ou desarma um temporizador associado a um timerfd.
Descrição
Contraparte de configuração de `timerfd_create`.
Header:
sys/timerfd.hman 2Desde o kernel 2.6.25Assinatura
int timerfd_settime(
int fd,
int flags,
const struct itimerspec * new_value,
struct itimerspec * old_value
);Parâmetros
| Parâmetro | Tipo | Descrição |
|---|---|---|
| fd | int | Descritor timerfd. |
| flags | int | TFD_TIMER_ABSTIME para tempo absoluto. |
| new_value | const struct itimerspec * | Novo valor e intervalo de repetição. |
| old_value | struct itimerspec * | Se não for NULL, recebe o valor anterior. |
Registradores (x86_64)
| Registrador | Papel | Argumento |
|---|---|---|
| rax | número da syscall (chamada) / valor de retorno (após SYSCALL) | — |
| rdi | argumento 1 | fdint |
| rsi | argumento 2 | flagsint |
| rdx | argumento 3 | new_valueconst struct itimerspec * |
| r10 | argumento 4 | old_valuestruct itimerspec * |
Valor de retorno
0 em sucesso; -1 em erro, com errno definido.
Códigos de erro (errno)
- EBADF(9)
- Descritor de arquivo inválido.
- EFAULT(14)
- Endereço de memória inválido (ponteiro fora do espaço de endereçamento válido).
- EINVAL(22)
- Argumento inválido.
Relacionadas
Equivalente em Windows Win32