next up previous contents index
Next: 9.9.4 fs_init: Provide a Up: 9.9 Extended POSIX Support Previous: 9.9.2 fd_set_console: initialize stdin

9.9.3 set_system_clock: initialize clock support

   

SYNOPSIS

#include <oskit/c/sys/time.h>

void set_system_clock(struct oskit_clock *clock);

DESCRIPTION

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);
        }

PARAMETERS

clock
A pointer to an instance implementing the oskit_clock interface.



University of Utah Flux Research Group