Пример #1
0
int 
erts_init_time_sup(void)
{
    erts_smp_mtx_init(&erts_timeofday_mtx, "timeofday");

    last_emu_time.tv_sec = 0;
    last_emu_time.tv_usec = 0;

#ifndef SYS_CLOCK_RESOLUTION
    clock_resolution = sys_init_time();
#else
    (void) sys_init_time();
#endif
    sys_gettimeofday(&inittv);
    
#ifdef HAVE_GETHRTIME
    sys_init_hrtime();
#endif
    init_tolerant_timeofday();

    init_erts_deliver_time(&inittv);
    gtv = inittv;
    then.tv_sec = then.tv_usec = 0;

    erts_get_emu_time(&erts_first_emu_time);

    return CLOCK_RESOLUTION;
}    
Пример #2
0
enum sys_retcode_t sys_init()
{
     int stack_location;

     sys_stack_start = (uint8_t *) & stack_location;

     if (sys_init_time() != SYS_OK)
          return SYS_E_FAIL;

     sys_set_stack_limit(DEFAULT_STACK_SIZE);

     return SYS_OK;
}