lib: posix: clock: Implement clock_settime

Set a base time, using the current uptime.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2018-06-25 16:43:54 -06:00 committed by Anas Nashif
commit 9d6f1c600f
2 changed files with 35 additions and 11 deletions

View file

@ -49,18 +49,8 @@ static inline s32_t _ts_to_ms(const struct timespec *to)
return (to->tv_sec * MSEC_PER_SEC) + (to->tv_nsec / NSEC_PER_MSEC);
}
/**
* @brief Set clock time.
*
* See IEEE 1003.1
*/
static inline int clock_settime(clockid_t clock_id, const struct timespec *ts)
{
errno = ENOSYS;
return -1;
}
int clock_gettime(clockid_t clock_id, struct timespec *ts);
int clock_settime(clockid_t clock_id, const struct timespec *ts);
/* Timer APIs */
int timer_create(clockid_t clockId, struct sigevent *evp, timer_t *timerid);
int timer_delete(timer_t timerid);