/* * MPSAFE */ int sys_clock_getres(struct clock_getres_args *uap) { int error; struct timespec ts; error = kern_clock_getres(uap->clock_id, &ts); if (error == 0) error = copyout(&ts, uap->tp, sizeof(ts)); return (error); }
int cloudabi_sys_clock_res_get(struct thread *td, struct cloudabi_sys_clock_res_get_args *uap) { struct timespec ts; cloudabi_timestamp_t cts; int error; clockid_t clockid; error = cloudabi_convert_clockid(uap->clock_id, &clockid); if (error != 0) return (error); error = kern_clock_getres(td, clockid, &ts); if (error != 0) return (error); error = cloudabi_convert_timespec(&ts, &cts); if (error != 0) return (error); td->td_retval[0] = cts; return (0); }
int sys_linux_clock_getres(struct linux_clock_getres_args *args) { struct timespec ts; struct l_timespec lts; int error; clockid_t nwhich = 0; /* XXX: GCC */ if (args->tp == NULL) return (0); error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) return (error); error = kern_clock_getres(nwhich, &ts); if (error != 0) return (error); native_to_linux_timespec(<s, &ts); return (copyout(<s, args->tp, sizeof lts)); }