int sys_linux_clock_gettime(struct linux_clock_gettime_args *args) { struct l_timespec lts; int error; clockid_t nwhich = 0; /* XXX: GCC */ struct timespec tp; error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) return (error); error = kern_clock_gettime(nwhich, &tp); if (error != 0) return (error); native_to_linux_timespec(<s, &tp); return (copyout(<s, args->tp, sizeof lts)); }
int linux_sys_clock_getres(struct proc *p, void *v, register_t *retval) { struct linux_sys_clock_getres_args *uap = v; struct sys_clock_getres_args cgr; int error; if (SCARG(uap, tp) == NULL) return 0; error = linux_to_native_clockid(&SCARG(&cgr, clock_id), SCARG(uap, which)); if (error != 0) return error; SCARG(&cgr, tp) = (struct timespec *)SCARG(uap, tp); return sys_clock_getres(p, &cgr, retval); }
int sys_linux_clock_settime(struct linux_clock_settime_args *args) { struct timespec ts; struct l_timespec lts; int error; clockid_t nwhich = 0; /* XXX: GCC */ error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) return (error); error = copyin(args->tp, <s, sizeof lts); if (error != 0) return (error); error = linux_to_native_timespec(&ts, <s); if (error != 0) return (error); return (kern_clock_settime(nwhich, &ts)); }
int linux_sys_clock_gettime(struct proc *p, void *v, register_t *retval) { struct linux_sys_clock_gettime_args *uap = v; clockid_t clockid = 0; struct timespec tp; struct l_timespec ltp; int error; error = linux_to_native_clockid(&clockid, SCARG(uap, which)); if (error != 0) return error; error = clock_gettime(p, clockid, &tp); if (error != 0) return error; native_to_linux_timespec(<p, &tp); return (copyout(<p, SCARG(uap, tp), sizeof ltp)); }