#include <oskit/c/sys/time.h>void set_system_clock(struct oskit_clock *clock);
This function provides the C library with a clock device. A typical call sequence in a standalone application might be as follows:#define LOCAL_TO_GMT(t) (t)->tv_sec += secondswest void start_clock() { oskit_timespec_t time; /* use fdev's default clock device */ oskit_clock_t *clock = oskit_clock_init(); oskit_rtc_get(&time); /* read rtc */ LOCAL_TO_GMT(&time); /* adjust for local time */ oskit_clock_settime(clock, &time); /* set time */ set_system_clock(clock); }
- clock
- A pointer to an instance implementing the oskit_clock interface.