From nobody Fri Nov 7 12:59:10 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 15478477938171005.998568065967; Fri, 18 Jan 2019 13:43:13 -0800 (PST) Received: from localhost ([127.0.0.1]:47538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbuw-0005Ld-32 for importer@patchew.org; Fri, 18 Jan 2019 16:43:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbkf-0005Ni-Sd for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkbke-0004v5-IN for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:33 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41193) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkbke-0004tQ-Bd for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:32 -0500 Received: by mail-pf1-x444.google.com with SMTP id b7so7192468pfi.8 for ; Fri, 18 Jan 2019 13:32:32 -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.32.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:32:30 -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=N4AEijcfhSLtaoaWm0ch5ZKqRV8AkG+w+zrqUah4AVM=; b=AZ/t2HYfbMEAscbm9eF9lL7HFTboFB8Knwj0Lw+6oTlElkkg5/j8AqLjhX6CkNTc5L 8v+jmyWu2JSuXyQ/kPN8STB5sBzIzRd2Lrdj7hJRwbk/6zWSHKVKVmU4WBDAHHc0kYPe FtMTw2EyyuRlIiXMnBn5nBlKRX4pAjhrf+gxE= 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=N4AEijcfhSLtaoaWm0ch5ZKqRV8AkG+w+zrqUah4AVM=; b=TzNsrjGgloJ4Rmed/YifZrccASR+4yPKSAdskCNVMOZRxa5tQeW2HSXCZrk96bpMRS /YagJhfJxYidIxEVumTebSwxmQ/RBBmmJJkdElrkdEJJxCn4bAYEyvjx9R1fhSM2JeZt +DQ1K7A4rVzRNSpFWPImoyf2X9x9hYqjVVJXjDBAMddigI5GNW8nKR0KYjtm/IhcT1R2 JA00T72smP/rGZkMjwX/3PyXTgVuga/tEUSi0nz8/UBH1kHZts861erTMTkVon+93LtG l07l5HOo/42fwXcL7/wPSik32ggdNiBw5fXJfX6zHMc6sQ8j7x84nF7/pnenOdd/IXnY bc+g== X-Gm-Message-State: AJcUukec98WKVmjKk67FSO4Irsa1jHMLrGQWSzbfmErFay8qOv60Fbrh CXzH8a70wE6Lz+zp49Cs/p3IxxI32iw= X-Google-Smtp-Source: ALg8bN6B8BaHZQkaDB1LIV9V0zcNbIouYExxADUxllf+yPUGbmzWI7tBawsCu2M+YSwlhvHkV+UfUA== X-Received: by 2002:a63:5b48:: with SMTP id l8mr19413851pgm.80.1547847151052; Fri, 18 Jan 2019 13:32:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 19 Jan 2019 08:31:00 +1100 Message-Id: <20190118213122.22865-27-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::444 Subject: [Qemu-devel] [PATCH v6 27/49] linux-user: Split out time 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 | 3 +++ linux-user/syscall-time.inc.c | 32 ++++++++++++++++++++++++++++++++ linux-user/syscall.c | 13 +------------ linux-user/strace.list | 3 --- 4 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 linux-user/syscall-time.inc.c diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index 3fad9d51f0..9950b73e76 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -127,6 +127,9 @@ SYSCALL_DEF(shmdt, ARG_PTR); #if !defined(SYSCALL_TABLE) || defined(TARGET_NR_shmget) SYSCALL_DEF(shmget, ARG_DEC, ARG_DEC, ARG_HEX); #endif +#ifdef TARGET_NR_time +SYSCALL_DEF(time, ARG_PTR); +#endif #ifdef TARGET_NR_unlink SYSCALL_DEF(unlink, ARG_STR); #endif diff --git a/linux-user/syscall-time.inc.c b/linux-user/syscall-time.inc.c new file mode 100644 index 0000000000..14fec88e47 --- /dev/null +++ b/linux-user/syscall-time.inc.c @@ -0,0 +1,32 @@ +/* + * Linux time related syscalls + * Copyright (c) 2003 Fabrice Bellard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifdef TARGET_NR_time +SYSCALL_IMPL(time) +{ + time_t host_time; + abi_long ret =3D get_errno(time(&host_time)); + + if (!is_error(ret) + && arg1 + && put_user_sal(host_time, arg1)) { + return -TARGET_EFAULT; + } + return ret; +} +#endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1cdc9727a9..cc5360ae43 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5331,18 +5331,6 @@ static abi_long do_syscall1(void *cpu_env, int num, = abi_long arg1, void *p; =20 switch(num) { -#ifdef TARGET_NR_time - case TARGET_NR_time: - { - time_t host_time; - ret =3D get_errno(time(&host_time)); - if (!is_error(ret) - && arg1 - && put_user_sal(host_time, arg1)) - return -TARGET_EFAULT; - } - return ret; -#endif #ifdef TARGET_NR_mknod case TARGET_NR_mknod: if (!(p =3D lock_user_string(arg1))) @@ -9303,6 +9291,7 @@ static abi_long do_syscall1(void *cpu_env, int num, a= bi_long arg1, #include "syscall-ipc.inc.c" #include "syscall-mem.inc.c" #include "syscall-proc.inc.c" +#include "syscall-time.inc.c" =20 #undef SYSCALL_IMPL #undef SYSCALL_ARGS diff --git a/linux-user/strace.list b/linux-user/strace.list index 357984dd6f..3505014501 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1350,9 +1350,6 @@ #ifdef TARGET_NR_tgkill { TARGET_NR_tgkill, "tgkill" , NULL, print_tgkill, NULL }, #endif -#ifdef TARGET_NR_time -{ TARGET_NR_time, "time" , NULL, NULL, NULL }, -#endif #ifdef TARGET_NR_timer_create { TARGET_NR_timer_create, "timer_create" , NULL, NULL, NULL }, #endif --=20 2.17.2