From nobody Fri Nov 7 13:00:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547848717431695.2226284837168; Fri, 18 Jan 2019 13:58:37 -0800 (PST) Received: from localhost ([127.0.0.1]:47754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkc9W-00013b-4y for importer@patchew.org; Fri, 18 Jan 2019 16:58:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkble-00068t-KW for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:33:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkblQ-0005t3-L2 for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:33:26 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:38211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkblO-0005jf-0s for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:33:18 -0500 Received: by mail-pf1-x443.google.com with SMTP id q1so7204236pfi.5 for ; Fri, 18 Jan 2019 13:33:13 -0800 (PST) Received: from cloudburst.twiddle.net ([2001:8000:10e0:a000:c673:a6b6:fdef:1933]) by smtp.gmail.com with ESMTPSA id v12sm5833667pgg.41.2019.01.18.13.33.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rux+kRu2UAl1QIPUh/1VQqUdHSpoV4AukU1szKGl9bY=; b=fBfvB5LT3Jk57DYzHjGUNedsBZ+273ivbG7f4lPFtGTB5DQXHoXizLILQrhf6ti3oE MnrG6mkm1kGipC5zoKAuEsiJoainGjzHT2NMzMM7je4hkX4/2e+VH9af7qnxm5DvSEs3 zEP38DN/VlLmbYnD1d55jVOHC0suazXOLjwhQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rux+kRu2UAl1QIPUh/1VQqUdHSpoV4AukU1szKGl9bY=; b=QjJaoUvyfy5m+KEA9NZZjkysGXNJIAf0/EHE2GPOJUPIQau5PPIZy47PnwwJ+XzFbx x6FvbwmqEKa37UAbHkle1WUTyPWDPzmnOtv+oj8SYAkT7P1pyQu9X4gDgkIaFkaSvJaN e94EVpOLxl9XYvMFxFJZSboHfAl2zcTlccHKAGThVgfFiNkJsZJL1NpIJqsh7bRAjJj5 eI9ft0/C+b5oAu/w/+g+OO8YnrquikDhrw/YjGoO3VmXyQCyRTx5kDxRiA7ByylNq8Q+ FMllnC1WB3mSDnpX+RZz4LQIWHHz+fHexLVv5prkO5Urk0p13LO8+66M4YrGiZe2uBx9 dNfg== X-Gm-Message-State: AJcUukfyA4iXAssgpfdv/je7vAoD+Q1DlAKFokB7Tg4ZNwezc1RCCikM qM2KCdm8KueWlGu+hF7JZ8nu78EdsLg= X-Google-Smtp-Source: ALg8bN51ESAYChf0S7nzRUBHFl9ejGrhaod+T+vB4NT2TA9KMHlKwzGqNg6GB87u8lajoeNroxN9Gg== X-Received: by 2002:a62:b80a:: with SMTP id p10mr19676364pfe.32.1547847192333; Fri, 18 Jan 2019 13:33:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 19 Jan 2019 08:31:18 +1100 Message-Id: <20190118213122.22865-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190118213122.22865-1-richard.henderson@linaro.org> References: <20190118213122.22865-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [PATCH v6 45/49] linux-user: Split out times X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- linux-user/syscall-defs.h | 1 + linux-user/syscall-proc.inc.c | 25 +++++++++++++++++++++++++ linux-user/syscall.c | 18 ------------------ linux-user/strace.list | 3 --- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index bd3301a72f..25d5aaccd1 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -204,6 +204,7 @@ SYSCALL_DEF(syncfs, ARG_DEC); #ifdef TARGET_NR_time SYSCALL_DEF(time, ARG_PTR); #endif +SYSCALL_DEF(times, ARG_PTR); #ifdef TARGET_NR_umount SYSCALL_DEF(umount, ARG_STR); #endif diff --git a/linux-user/syscall-proc.inc.c b/linux-user/syscall-proc.inc.c index 58c0a22300..09a0306406 100644 --- a/linux-user/syscall-proc.inc.c +++ b/linux-user/syscall-proc.inc.c @@ -468,6 +468,31 @@ SYSCALL_IMPL(nice) } #endif =20 +SYSCALL_IMPL(times) +{ + abi_ulong target_buf =3D arg1; + struct tms tms; + abi_long ret; + + ret =3D get_errno(times(&tms)); + if (target_buf) { + struct target_tms *tmsp =3D lock_user(VERIFY_WRITE, target_buf, + sizeof(struct target_tms), 0); + if (!tmsp) { + return -TARGET_EFAULT; + } + tmsp->tms_utime =3D tswapal(host_to_target_clock_t(tms.tms_utime)); + tmsp->tms_stime =3D tswapal(host_to_target_clock_t(tms.tms_stime)); + tmsp->tms_cutime =3D tswapal(host_to_target_clock_t(tms.tms_cutime= )); + tmsp->tms_cstime =3D tswapal(host_to_target_clock_t(tms.tms_cstime= )); + unlock_user(tmsp, target_buf, sizeof(struct target_tms)); + } + if (!is_error(ret)) { + ret =3D host_to_target_clock_t(ret); + } + return ret; +} + /* * Map host to target signal numbers for the wait family of syscalls. * Assume all other status bits are the same. diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3a322a61ca..d0bf339281 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5293,24 +5293,6 @@ static abi_long do_syscall1(void *cpu_env, int num, = abi_long arg1, void *p; =20 switch(num) { - case TARGET_NR_times: - { - struct target_tms *tmsp; - struct tms tms; - ret =3D get_errno(times(&tms)); - if (arg1) { - tmsp =3D lock_user(VERIFY_WRITE, arg1, sizeof(struct targe= t_tms), 0); - if (!tmsp) - return -TARGET_EFAULT; - tmsp->tms_utime =3D tswapal(host_to_target_clock_t(tms.tms= _utime)); - tmsp->tms_stime =3D tswapal(host_to_target_clock_t(tms.tms= _stime)); - tmsp->tms_cutime =3D tswapal(host_to_target_clock_t(tms.tm= s_cutime)); - tmsp->tms_cstime =3D tswapal(host_to_target_clock_t(tms.tm= s_cstime)); - } - if (!is_error(ret)) - ret =3D host_to_target_clock_t(ret); - } - return ret; case TARGET_NR_acct: if (arg1 =3D=3D 0) { ret =3D get_errno(acct(NULL)); diff --git a/linux-user/strace.list b/linux-user/strace.list index ac25e13bfa..4ea11f162e 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1290,9 +1290,6 @@ #ifdef TARGET_NR_timerfd_settime { TARGET_NR_timerfd_settime, "timerfd_settime" , NULL, NULL, NULL }, #endif -#ifdef TARGET_NR_times -{ TARGET_NR_times, "times" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_tkill { TARGET_NR_tkill, "tkill" , NULL, print_tkill, NULL }, #endif --=20 2.17.2