Timerfd helpers.
More...
#include <stdbool.h>
Go to the source code of this file.
◆ mympd_timer_close()
| void mympd_timer_close |
( |
int |
fd | ) |
|
Closes the timer
- Parameters
-
◆ mympd_timer_create()
| int mympd_timer_create |
( |
int |
clock, |
|
|
int |
timeout, |
|
|
int |
interval |
|
) |
| |
Creates a new timer
- Parameters
-
| clock | one off CLOCK_MONOTONIC or CLOCK_REALTIME |
| timeout | timeout in seconds |
| interval | interval in seconds |
- Returns
- timer fd
◆ mympd_timer_log_next_expire()
| void mympd_timer_log_next_expire |
( |
int |
timer_fd | ) |
|
Logs the next timer expiration.
- Parameters
-
◆ mympd_timer_read()
| bool mympd_timer_read |
( |
int |
fd | ) |
|
Reads from a timerfd
- Parameters
-
- Returns
- true on success, else false
◆ mympd_timer_set()
| bool mympd_timer_set |
( |
int |
timer_fd, |
|
|
int |
timeout, |
|
|
int |
interval |
|
) |
| |
Sets the relative timeout and interval for a timer fd.
- Parameters
-
| timer_fd | timer fd |
| timeout | relative timeout in seconds |
| interval | interval in seconds |
- Returns
- true on success, else false