From nobody Sun May 08 13:17:11 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 528081AD7B45; Sun, 8 May 2022 13:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kx4bD05cWz4q91; Sun, 8 May 2022 13:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652015832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sfi2lUiQvlv+gtPNaSTpPEIkdgJr0ZpRISiA2TP4thU=; b=rq+IJCHLqbFUWeEZqKrdjK1TYeW/MKIN2v+4S48mAyqB0DXdxXgIy990cqOKy7Zc8Rfhro BoQ7hzNYa6OihPkpKWYVTQIeUcLNQ7XtgNsxk2Rdqy5xXaFU4xg46iPA1I6SspL3UuCXzy 3phw/ar+QX6LmTaRulzDnRQm4So70i2c4CKZB3iwqmBljcojp+ZukBTCUoXgHN0n9sR6fE dEU2ok9NPg/MrAuPPN9XHjSRNu38gvfCpbyuQppUNuhwS/A/jVqwk6rljJyXTQbPIhW2d/ cNOpt+6qvbD2ocglQ0S2yCFU8LEk+f4CVPK0lBhs+7Duy88pawTpmY/WW0iPMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5E6825544; Sun, 8 May 2022 13:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 248DHB3l044085; Sun, 8 May 2022 13:17:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 248DHBAX044084; Sun, 8 May 2022 13:17:11 GMT (envelope-from git) Date: Sun, 8 May 2022 13:17:11 GMT Message-Id: <202205081317.248DHBAX044084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 707e567a4061 - main - linux(4): Add a helper intended for copying timespec's from the userspace. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 707e567a4061669b7643ddbe8a1ad9c4e6545a75 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652015832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sfi2lUiQvlv+gtPNaSTpPEIkdgJr0ZpRISiA2TP4thU=; b=WxEtdBTtOhe3jgrE6j21sTZXLNdLEl811Vvisv6D+ZoBOXAYuqWBSU5Lv8gzv7VArBOUU/ ne3vOF+rfsOPTmPmUpKA8dL1LOSzimCxrYFofVaFb4GS115i2Oj5bvu8+Z/rrDbDymGAL3 Y4wa0KU2sm3QaxC/0XZCccnbojY6YrO+KG3ARwvTO/5w6rwBivHBtK1smtAZ7ODpmMyyG5 MP5tNf+RpQVhgZG+BR45kFG7JWpGkiJKG84uAUfp+hpUIbs2cySJ5mXnD67b01Xb5Y7h1r lA4V/yvE8xJ9fYfgvEgMrcRcInVS9yf8XiEClOOa+obEgS6xKCFmBo1Mjc+ABg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652015832; a=rsa-sha256; cv=none; b=Ghc3vLRJkTH0elnAC8EY72MdGfsS2kUnSSc/+J8M7zvyPCG8ldSnKE7ESZ3ozWBdqbmokM ff9SDWtCZrp4nz4afyH3YAqeWtWwZs9+WJgsJ6V8Oe7kem5ZLInnSGRfzxXlSwhryNXqNJ 41tQGsjY8nynUSOmIoYidsgf/42vEq/br3/KolBMwsv0klIOdlHVricXCeXGMpR0XpjybO Ala0+fXj7ADOKQbFnyQhx7B+iKJZKVO+cT5N2wxVqJf6pYGvqF0+9QlQgXGldLYZkdqi+Z h50ofHA0P8jWzkx4jaaW0iTwxOf/XCK3QM4hlsoLD5ETtTFzhY5MYvki9NY6CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=707e567a4061669b7643ddbe8a1ad9c4e6545a75 commit 707e567a4061669b7643ddbe8a1ad9c4e6545a75 Author: Dmitry Chagin AuthorDate: 2022-05-08 13:16:47 +0000 Commit: Dmitry Chagin CommitDate: 2022-05-08 13:16:47 +0000 linux(4): Add a helper intended for copying timespec's from the userspace. There are many places where we copyin Linux timespec from the userspace and then convert it to the kernel timespec. To avoid code duplication add a tiny halper for doing this. MFC after: 2 weeks --- sys/compat/linux/linux_event.c | 10 ++---- sys/compat/linux/linux_futex.c | 12 ++----- sys/compat/linux/linux_ipc.c | 10 ++---- sys/compat/linux/linux_misc.c | 24 +++----------- sys/compat/linux/linux_signal.c | 10 ++---- sys/compat/linux/linux_socket.c | 12 ++----- sys/compat/linux/linux_time.c | 73 ++++++++++++++++------------------------- sys/compat/linux/linux_timer.h | 4 +++ 8 files changed, 47 insertions(+), 108 deletions(-) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 5e62848303f1..e03335a87ec4 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -540,7 +540,6 @@ int linux_epoll_pwait2_64(struct thread *td, struct linux_epoll_pwait2_64_args *args) { struct timespec ts, *tsa; - struct l_timespec64 lts; sigset_t mask, *pmask; int error; @@ -550,9 +549,7 @@ linux_epoll_pwait2_64(struct thread *td, struct linux_epoll_pwait2_64_args *args return (error); if (args->timeout) { - if ((error = copyin(args->timeout, <s, sizeof(lts)))) - return (error); - error = linux_to_native_timespec64(&ts, <s); + error = linux_get_timespec64(&ts, args->timeout); if (error != 0) return (error); tsa = &ts; @@ -567,7 +564,6 @@ int linux_epoll_pwait2(struct thread *td, struct linux_epoll_pwait2_args *args) { struct timespec ts, *tsa; - struct l_timespec lts; sigset_t mask, *pmask; int error; @@ -577,9 +573,7 @@ linux_epoll_pwait2(struct thread *td, struct linux_epoll_pwait2_args *args) return (error); if (args->timeout) { - if ((error = copyin(args->timeout, <s, sizeof(lts)))) - return (error); - error = linux_to_native_timespec(&ts, <s); + error = linux_get_timespec(&ts, args->timeout); if (error != 0) return (error); tsa = &ts; diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index a194e0ac7962..5591b4fc3234 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -816,7 +816,6 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) .val3 = args->val3, .val3_compare = true, }; - struct l_timespec lts; int error; switch (args->op & LINUX_FUTEX_CMD_MASK) { @@ -825,10 +824,7 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) case LINUX_FUTEX_LOCK_PI: case LINUX_FUTEX_LOCK_PI2: if (args->timeout != NULL) { - error = copyin(args->timeout, <s, sizeof(lts)); - if (error != 0) - return (error); - error = linux_to_native_timespec(&fargs.kts, <s); + error = linux_get_timespec(&fargs.kts, args->timeout); if (error != 0) return (error); fargs.ts = &fargs.kts; @@ -854,7 +850,6 @@ linux_sys_futex_time64(struct thread *td, .val3 = args->val3, .val3_compare = true, }; - struct l_timespec64 lts; int error; switch (args->op & LINUX_FUTEX_CMD_MASK) { @@ -863,10 +858,7 @@ linux_sys_futex_time64(struct thread *td, case LINUX_FUTEX_LOCK_PI: case LINUX_FUTEX_LOCK_PI2: if (args->timeout != NULL) { - error = copyin(args->timeout, <s, sizeof(lts)); - if (error != 0) - return (error); - error = linux_to_native_timespec64(&fargs.kts, <s); + error = linux_get_timespec64(&fargs.kts, args->timeout); if (error != 0) return (error); fargs.ts = &fargs.kts; diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 51bf18dcd097..258917e6a969 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -510,13 +510,10 @@ int linux_semtimedop_time64(struct thread *td, struct linux_semtimedop_time64_args *args) { struct timespec ts, *tsa; - struct l_timespec64 lts; int error; if (args->timeout) { - if ((error = copyin(args->timeout, <s, sizeof(lts)))) - return (error); - error = linux_to_native_timespec64(&ts, <s); + error = linux_get_timespec64(&ts, args->timeout); if (error != 0) return (error); tsa = &ts; @@ -532,13 +529,10 @@ int linux_semtimedop(struct thread *td, struct linux_semtimedop_args *args) { struct timespec ts, *tsa; - struct l_timespec lts; int error; if (args->timeout) { - if ((error = copyin(args->timeout, <s, sizeof(lts)))) - return (error); - error = linux_to_native_timespec(&ts, <s); + error = linux_get_timespec(&ts, args->timeout); if (error != 0) return (error); tsa = &ts; diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 81002540633e..54fbc9e2b938 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -2380,15 +2380,11 @@ linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) int linux_pselect6(struct thread *td, struct linux_pselect6_args *args) { - struct l_timespec lts; struct timespec ts, *tsp; int error; if (args->tsp != NULL) { - error = copyin(args->tsp, <s, sizeof(lts)); - if (error != 0) - return (error); - error = linux_to_native_timespec(&ts, <s); + error = linux_get_timespec(&ts, args->tsp); if (error != 0) return (error); tsp = &ts; @@ -2472,15 +2468,11 @@ int linux_pselect6_time64(struct thread *td, struct linux_pselect6_time64_args *args) { - struct l_timespec64 lts; struct timespec ts, *tsp; int error; if (args->tsp != NULL) { - error = copyin(args->tsp, <s, sizeof(lts)); - if (error != 0) - return (error); - error = linux_to_native_timespec64(&ts, <s); + error = linux_get_timespec64(&ts, args->tsp); if (error != 0) return (error); tsp = &ts; @@ -2500,14 +2492,10 @@ int linux_ppoll(struct thread *td, struct linux_ppoll_args *args) { struct timespec uts, *tsp; - struct l_timespec lts; int error; if (args->tsp != NULL) { - error = copyin(args->tsp, <s, sizeof(lts)); - if (error) - return (error); - error = linux_to_native_timespec(&uts, <s); + error = linux_get_timespec(&uts, args->tsp); if (error != 0) return (error); tsp = &uts; @@ -2582,14 +2570,10 @@ int linux_ppoll_time64(struct thread *td, struct linux_ppoll_time64_args *args) { struct timespec uts, *tsp; - struct l_timespec64 lts; int error; if (args->tsp != NULL) { - error = copyin(args->tsp, <s, sizeof(lts)); - if (error != 0) - return (error); - error = linux_to_native_timespec64(&uts, <s); + error = linux_get_timespec64(&uts, args->tsp); if (error != 0) return (error); tsp = &uts; diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 0848040d009c..a9af0d726f56 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -436,13 +436,10 @@ linux_rt_sigtimedwait(struct thread *td, struct linux_rt_sigtimedwait_args *args) { struct timespec ts, *tsa; - struct l_timespec lts; int error; if (args->timeout) { - if ((error = copyin(args->timeout, <s, sizeof(lts)))) - return (error); - error = linux_to_native_timespec(&ts, <s); + error = linux_get_timespec(&ts, args->timeout); if (error != 0) return (error); tsa = &ts; @@ -490,13 +487,10 @@ linux_rt_sigtimedwait_time64(struct thread *td, struct linux_rt_sigtimedwait_time64_args *args) { struct timespec ts, *tsa; - struct l_timespec64 lts; int error; if (args->timeout) { - if ((error = copyin(args->timeout, <s, sizeof(lts)))) - return (error); - error = linux_to_native_timespec64(&ts, <s); + error = linux_get_timespec64(&ts, args->timeout); if (error != 0) return (error); tsa = &ts; diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 93b5cea7ecc3..b5ec32835981 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1786,15 +1786,11 @@ linux_recvmmsg_common(struct thread *td, l_int s, struct l_mmsghdr *msg, int linux_recvmmsg(struct thread *td, struct linux_recvmmsg_args *args) { - struct l_timespec lts; struct timespec ts, tts, *ptts; int error; if (args->timeout) { - error = copyin(args->timeout, <s, sizeof(struct l_timespec)); - if (error != 0) - return (error); - error = linux_to_native_timespec(&ts, <s); + error = linux_get_timespec(&ts, args->timeout); if (error != 0) return (error); getnanotime(&tts); @@ -1811,15 +1807,11 @@ linux_recvmmsg(struct thread *td, struct linux_recvmmsg_args *args) int linux_recvmmsg_time64(struct thread *td, struct linux_recvmmsg_time64_args *args) { - struct l_timespec64 lts; struct timespec ts, tts, *ptts; int error; if (args->timeout) { - error = copyin(args->timeout, <s, sizeof(struct l_timespec)); - if (error != 0) - return (error); - error = linux_to_native_timespec64(&ts, <s); + error = linux_get_timespec64(&ts, args->timeout); if (error != 0) return (error); getnanotime(&tts); diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c index 0f1af6b3a5cf..0be7025abe05 100644 --- a/sys/compat/linux/linux_time.c +++ b/sys/compat/linux/linux_time.c @@ -101,16 +101,13 @@ LIN_SDT_PROBE_DEFINE1(time, linux_clock_getres, copyout_error, "int"); #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) LIN_SDT_PROBE_DEFINE1(time, linux_clock_getres_time64, copyout_error, "int"); #endif -LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, conversion_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, copyout_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, copyin_error, "int"); -LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, conversion_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, copyout_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, copyin_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_common_clock_nanosleep, unsupported_flags, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_common_clock_nanosleep, unsupported_clockid, "int"); #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) -LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep_time64, conversion_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep_time64, copyout_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep_time64, copyin_error, "int"); #endif @@ -162,6 +159,18 @@ linux_put_timespec(struct timespec *ntp, struct l_timespec *ltp) return (copyout(<s, ltp, sizeof(lts))); } +int +linux_get_timespec(struct timespec *ntp, const struct l_timespec *ultp) +{ + struct l_timespec lts; + int error; + + error = copyin(ultp, <s, sizeof(lts)); + if (error != 0) + return (error); + return (linux_to_native_timespec(ntp, <s)); +} + #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int native_to_linux_timespec64(struct l_timespec64 *ltp64, struct timespec *ntp) @@ -203,6 +212,18 @@ linux_put_timespec64(struct timespec *ntp, struct l_timespec64 *ltp) return (error); return (copyout(<s, ltp, sizeof(lts))); } + +int +linux_get_timespec64(struct timespec *ntp, const struct l_timespec64 *ultp) +{ + struct l_timespec64 lts; + int error; + + error = copyin(ultp, <s, sizeof(lts)); + if (error != 0) + return (error); + return (linux_to_native_timespec64(ntp, <s)); +} #endif int @@ -508,19 +529,13 @@ int linux_clock_settime(struct thread *td, struct linux_clock_settime_args *args) { struct timespec ts; - struct l_timespec lts; int error; - error = copyin(args->tp, <s, sizeof(lts)); + error = linux_get_timespec(&ts, args->tp); if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_settime, copyin_error, error); return (error); } - error = linux_to_native_timespec(&ts, <s); - if (error != 0) - LIN_SDT_PROBE1(time, linux_clock_settime, conversion_error, - error); - return (linux_common_clock_settime(td, args->which, &ts)); } @@ -529,18 +544,13 @@ int linux_clock_settime64(struct thread *td, struct linux_clock_settime64_args *args) { struct timespec ts; - struct l_timespec64 lts; int error; - error = copyin(args->tp, <s, sizeof(lts)); + error = linux_get_timespec64(&ts, args->tp); if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_settime64, copyin_error, error); return (error); } - error = linux_to_native_timespec64(&ts, <s); - if (error != 0) - LIN_SDT_PROBE1(time, linux_clock_settime64, conversion_error, - error); return (linux_common_clock_settime(td, args->which, &ts)); } #endif @@ -680,26 +690,19 @@ int linux_nanosleep(struct thread *td, struct linux_nanosleep_args *args) { struct timespec *rmtp; - struct l_timespec lrqts; struct timespec rqts, rmts; int error, error2; - error = copyin(args->rqtp, &lrqts, sizeof lrqts); + error = linux_get_timespec(&rqts, args->rqtp); if (error != 0) { LIN_SDT_PROBE1(time, linux_nanosleep, copyin_error, error); return (error); } - if (args->rmtp != NULL) rmtp = &rmts; else rmtp = NULL; - error = linux_to_native_timespec(&rqts, &lrqts); - if (error != 0) { - LIN_SDT_PROBE1(time, linux_nanosleep, conversion_error, error); - return (error); - } error = kern_nanosleep(td, &rqts, rmtp); if (error == EINTR && args->rmtp != NULL) { error2 = linux_put_timespec(rmtp, args->rmtp); @@ -746,24 +749,15 @@ linux_clock_nanosleep(struct thread *td, struct linux_clock_nanosleep_args *args) { struct timespec *rmtp; - struct l_timespec lrqts; struct timespec rqts, rmts; int error, error2; - error = copyin(args->rqtp, &lrqts, sizeof(lrqts)); + error = linux_get_timespec(&rqts, args->rqtp); if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_nanosleep, copyin_error, error); return (error); } - - error = linux_to_native_timespec(&rqts, &lrqts); - if (error != 0) { - LIN_SDT_PROBE1(time, linux_clock_nanosleep, conversion_error, - error); - return (error); - } - if (args->rmtp != NULL) rmtp = &rmts; else @@ -789,24 +783,15 @@ linux_clock_nanosleep_time64(struct thread *td, struct linux_clock_nanosleep_time64_args *args) { struct timespec *rmtp; - struct l_timespec64 lrqts; struct timespec rqts, rmts; int error, error2; - error = copyin(args->rqtp, &lrqts, sizeof(lrqts)); + error = linux_get_timespec64(&rqts, args->rqtp); if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_nanosleep_time64, copyin_error, error); return (error); } - - error = linux_to_native_timespec64(&rqts, &lrqts); - if (error != 0) { - LIN_SDT_PROBE1(time, linux_clock_nanosleep_time64, - conversion_error, error); - return (error); - } - if (args->rmtp != NULL) rmtp = &rmts; else diff --git a/sys/compat/linux/linux_timer.h b/sys/compat/linux/linux_timer.h index edff6c845032..b9f877cc83a4 100644 --- a/sys/compat/linux/linux_timer.h +++ b/sys/compat/linux/linux_timer.h @@ -117,6 +117,8 @@ int linux_to_native_timespec(struct timespec *, struct l_timespec *); int linux_put_timespec(struct timespec *, struct l_timespec *); +int linux_get_timespec(struct timespec *, + const struct l_timespec *); #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int native_to_linux_timespec64(struct l_timespec64 *, struct timespec *); @@ -124,6 +126,8 @@ int linux_to_native_timespec64(struct timespec *, struct l_timespec64 *); int linux_put_timespec64(struct timespec *, struct l_timespec64 *); +int linux_get_timespec64(struct timespec *, + const struct l_timespec64 *); #endif int linux_to_native_clockid(clockid_t *, clockid_t); int native_to_linux_itimerspec(struct l_itimerspec *,