|
myMPD
Internal API documentation
|
Timerfd helpers. More...
#include "compile_time.h"#include "src/lib/timer.h"#include "src/lib/datetime.h"#include "src/lib/log.h"#include <errno.h>#include <sys/timerfd.h>#include <unistd.h>
Functions | |
| int | mympd_timer_create (int clock, int timeout, int interval) |
| bool | mympd_timer_read (int fd) |
| bool | mympd_timer_set (int timer_fd, int timeout, int interval) |
| void | mympd_timer_log_next_expire (int timer_fd) |
| void | mympd_timer_close (int fd) |
Timerfd helpers.
| void mympd_timer_close | ( | int | fd | ) |
Closes the timer
| fd | fd to close |
| int mympd_timer_create | ( | int | clock, |
| int | timeout, | ||
| int | interval | ||
| ) |
Creates a new timer
| clock | one off CLOCK_MONOTONIC or CLOCK_REALTIME |
| timeout | timeout in seconds |
| interval | interval in seconds |
| void mympd_timer_log_next_expire | ( | int | timer_fd | ) |
Logs the next timer expiration.
| timer_fd | timer fd |
| bool mympd_timer_read | ( | int | fd | ) |
Reads from a timerfd
| fd | read from this fd |
| bool mympd_timer_set | ( | int | timer_fd, |
| int | timeout, | ||
| int | interval | ||
| ) |
Sets the relative timeout and interval for a timer fd.
| timer_fd | timer fd |
| timeout | relative timeout in seconds |
| interval | interval in seconds |