Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 490

Show
Ignore:
Timestamp:
01/08/11 21:20:00 (14 years ago)
Author:
braddr
Message:

add the missing CLOCK_* enums

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/core/sys/posix/time.d

    r441 r490  
    113113int nanosleep(in timespec*, timespec*); 
    114114int timer_create(clockid_t, sigevent*, timer_t*); 
    115115int timer_delete(timer_t); 
    116116int timer_gettime(timer_t, itimerspec*); 
    117117int timer_getoverrun(timer_t); 
    118118int timer_settime(timer_t, int, in itimerspec*, itimerspec*); 
    119119*/ 
    120120 
    121121version( linux ) 
    122122{ 
    123     enum CLOCK_PROCESS_CPUTIME_ID   = 2; // (TMR|CPT) 
    124     enum CLOCK_THREAD_CPUTIME_ID    = 3; // (TMR|TCT) 
    125  
    126123    // NOTE: See above for why this is commented out. 
    127124    // 
    128125    //struct timespec 
    129126    //{ 
    130127    //    time_t  tv_sec; 
    131128    //    c_long  tv_nsec; 
    132129    //} 
    133130 
    134131    struct itimerspec 
    135132    { 
    136133        timespec it_interval; 
    137134        timespec it_value; 
    138135    } 
    139136 
    140     enum CLOCK_REALTIME     = 0; 
    141     enum TIMER_ABSTIME      = 0x01; 
     137    enum CLOCK_REALTIME           = 0; // Identifier for system-wide realtime clock. 
     138    enum CLOCK_MONOTONIC          = 1; // Monotonic system-wide clock. 
     139    enum CLOCK_PROCESS_CPUTIME_ID = 2; // High-resolution timer from the CPU. 
     140    enum CLOCK_THREAD_CPUTIME_ID  = 3; // Thread-specific CPU-time clock. 
     141    enum CLOCK_MONOTONIC_RAW      = 4; // Monotonic system-wide clock, not adjusted for frequency scaling. 
     142    enum CLOCK_REALTIME_COARSE    = 5; // Identifier for system-wide realtime clock, updated only on ticks. 
     143    enum CLOCK_MONOTONIC_COARSE   = 6; // Monotonic system-wide clock, updated only on ticks. 
     144 
     145    enum TIMER_ABSTIME = 0x01; 
    142146 
    143147    alias int clockid_t; 
    144148    alias int timer_t; 
    145149 
    146150    int clock_getres(clockid_t, timespec*); 
    147151    int clock_gettime(clockid_t, timespec*); 
    148152    int clock_settime(clockid_t, in timespec*); 
    149153    int nanosleep(in timespec*, timespec*); 
    150154    int timer_create(clockid_t, sigevent*, timer_t*); 
    151155    int timer_delete(timer_t);