SYSTIMER(9)

NAME
systimer_init_periodic, systimer_init_periodic_nq, systimer_adjust_periodic, systimer_init_oneshot - periodic callbacks

SYNOPSIS
#include <sys/systimer.h>
void
systimer_init_periodic(systimer_t info, systimer_func_t func, void *data, int64_t freq);
void
systimer_init_periodic_nq(systimer_t info, systimer_func_t func, void *data, int64_t freq);
void
systimer_adjust_periodic(systimer_t info, int64_t freq);
void
systimer_init_oneshot(systimer_t info, systimer_func_t func, void *data, int64_t us);

DESCRIPTION
Systimers invoke callbacks at either fixed frequencies or after time delays. The callbacks are invoked in an interrupt thread and should only be used for limited work.

The systimer_init_periodic() function initializes a systimer callback function to be called at frequency freq. The info argument is an allocated systimer structure; the func argument is the function to call, with argument data.

The systimer_init_periodic_nq() function initializes a systimer callback function to be called at a frequency freq. Unlike the systimer_init_periodic() function, the systimer_init_periodic_nq() function's callback is only called once at a given time, even if delays caused multiple time intervals to have occurred.

The systimer_adjust_periodic() function changes the frequency at which a systimer's callback is invoked. The current time interval is not affected. The freq argument specifies the new frequency.

The systimer_init_oneshot() function arranges for a systimer callback function func to be invoked with argument data once, after at least us microseconds.

FILES
The systimer implementation is in /sys/kern/kern_systimer.c.

EXAMPLES
A simple example of using a one-short systimer to call a function after a short time:

    ...
    static struct systimer short_st;
    char *str = "goodbye!";
    ...
    systimer_init_oneshot(&short_st, panic, str, 1000);
    ...

SEE ALSO
callout(9)

HISTORY
Systimers first appeared in DragonFly 1.0.