Changeset 163eccd7 in mainline
- Timestamp:
- 2026-08-14T11:55:35Z (27 hours ago)
- Children:
- 6b1d0879
- Parents:
- 48cc66f
- git-author:
- Matěj Volf <git@…> (2025-11-05 22:08:49)
- git-committer:
- Matěj Volf <git@…> (2026-08-14 11:55:35)
- Location:
- uspace/lib/posix
- Files:
-
- 2 edited
-
include/posix/time.h (modified) (1 diff)
-
src/time.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/time.h
r48cc66f r163eccd7 42 42 43 43 #define CLOCK_REALTIME ((clockid_t) 0) 44 #define CLOCK_MONOTONIC ((clockid_t) 1) 44 45 45 46 #define ASCTIME_BUF_LEN 26 -
uspace/lib/posix/src/time.c
r48cc66f r163eccd7 206 206 207 207 /** 208 * Get clock resolution. Only CLOCK_REALTIME is supported.208 * Get clock resolution. 209 209 * 210 210 * @param clock_id Clock ID. … … 218 218 switch (clock_id) { 219 219 case CLOCK_REALTIME: 220 case CLOCK_MONOTONIC: 220 221 res->tv_sec = 0; 221 222 res->tv_nsec = USEC2NSEC(1); /* Microsecond resolution. */ … … 228 229 229 230 /** 230 * Get time. Only CLOCK_REALTIME is supported.231 * Get time. 231 232 * 232 233 * @param clock_id ID of the clock to query. … … 246 247 tp->tv_nsec = USEC2NSEC(tv.tv_usec); 247 248 return 0; 249 case CLOCK_MONOTONIC: 250 getuptime(tp); 251 return 0; 248 252 default: 249 253 errno = EINVAL; … … 267 271 switch (clock_id) { 268 272 case CLOCK_REALTIME: 273 case CLOCK_MONOTONIC: 269 274 // TODO: setting clock 270 275 // FIXME: HelenOS doesn't actually support hardware
Note:
See TracChangeset
for help on using the changeset viewer.
