2013-03-30 17:59:21 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <lib.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#ifdef __weak_alias
|
|
|
|
__weak_alias(clock_settime, __clock_settime50);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int clock_settime(clockid_t clock_id, const struct timespec *ts)
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-03-31 03:24:24 +02:00
|
|
|
m.m2_i2 = 1; /* set time immediately. don't use adjtime() method. */
|
2013-03-30 17:59:21 +01:00
|
|
|
m.m2_i1 = (clockid_t) clock_id;
|
|
|
|
m.m2_l1 = (time_t) ts->tv_sec;
|
|
|
|
m.m2_l2 = (long) ts->tv_nsec;
|
|
|
|
|
|
|
|
if (_syscall(PM_PROC_NR, CLOCK_SETTIME, &m) < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|