Skip to content

Commit 6536344

Browse files
committed
Implement clock_getres
Some packages (like python3) assume that clock_getres() is also available when clock_gettime() is
1 parent 79b086c commit 6536344

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

include/time.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,12 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__));
278278
extern int nanosleep (__const struct timespec *__requested_time,
279279
struct timespec *__remaining);
280280

281-
extern int clock_gettime(clockid_t clock_id, struct timespec *tp);
281+
/* Get resolution of clock CLOCK_ID. */
282+
extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW;
283+
284+
/* Get current value of clock CLOCK_ID and store it in TP. */
285+
extern int clock_gettime(clockid_t clock_id, struct timespec *tp)
286+
__THROW __nonnull((2));
282287

283288
extern int clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
284289
struct timespec *rem);

posix/SRCFILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SRCFILES = \
2121
isfdtype.c \
2222
nanosleep.c \
2323
clock_gettime.c \
24+
clock_getres.c \
2425
clock_nanosleep.c \
2526
posix_fallocate.c \
2627
pread.c \

0 commit comments

Comments
 (0)