Changes in / [48cc66f:6b1d0879] in mainline


Ignore:
Location:
uspace/lib/posix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/time.h

    r48cc66f r6b1d0879  
    4242
    4343#define CLOCK_REALTIME ((clockid_t) 0)
     44#define CLOCK_MONOTONIC ((clockid_t) 1)
    4445
    4546#define ASCTIME_BUF_LEN  26
  • uspace/lib/posix/src/time.c

    r48cc66f r6b1d0879  
    206206
    207207/**
    208  * Get clock resolution. Only CLOCK_REALTIME is supported.
     208 * Get clock resolution.
    209209 *
    210210 * @param clock_id Clock ID.
     
    218218        switch (clock_id) {
    219219        case CLOCK_REALTIME:
     220        case CLOCK_MONOTONIC:
    220221                res->tv_sec = 0;
    221222                res->tv_nsec = USEC2NSEC(1); /* Microsecond resolution. */
     
    228229
    229230/**
    230  * Get time. Only CLOCK_REALTIME is supported.
     231 * Get time.
    231232 *
    232233 * @param clock_id ID of the clock to query.
     
    246247                tp->tv_nsec = USEC2NSEC(tv.tv_usec);
    247248                return 0;
     249        case CLOCK_MONOTONIC:
     250                getuptime(tp);
     251                return 0;
    248252        default:
    249253                errno = EINVAL;
     
    267271        switch (clock_id) {
    268272        case CLOCK_REALTIME:
     273        case CLOCK_MONOTONIC:
    269274                // TODO: setting clock
    270275                // FIXME: HelenOS doesn't actually support hardware
Note: See TracChangeset for help on using the changeset viewer.