Changeset 6b1d0879 in mainline


Ignore:
Timestamp:
2026-08-14T12:02:04Z (25 hours ago)
Author:
GitHub <noreply@…>
Parents:
48cc66f (diff), 163eccd7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Matej Volf <mat.volfik@…> (2026-08-14 12:02:04)
git-committer:
GitHub <noreply@…> (2026-08-14 12:02:04)
Message:

Merge 163eccd733cf583a9e5131065a37ca2fcc8634e4 into 48cc66faec96bc448eb5c1a946b6c0f2f7890b04

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.