From patchwork Fri Jan 18 21:30:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156086 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3750675jaa; Fri, 18 Jan 2019 14:04:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6hUW9sHE7O1Z6RX7cGv1VHgHog/wUhG9yTyBfNwzKoAZIsHQzXjXDuBcgg4FYUJNNonOM8 X-Received: by 2002:adf:dfd1:: with SMTP id q17mr19180540wrn.27.1547849072483; Fri, 18 Jan 2019 14:04:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547849072; cv=none; d=google.com; s=arc-20160816; b=AFuqntix8HKNeMoA5pdnNfullQF+DK+pQluHsK1wgqhg9R4rsEWO0Lzy2pSXWEUEfR yIPAKkRmHT7pTjaFAJf03YvjJqamGZciitivOeEY/aDc5h0JORE99Zc5W6NrwsbEWKtF o07kAucb5L2B25lhsUgHK8wkw28qjHY1dJfWXhethSvTBypJNVyBMIgCTK64TznnwtjE JOJOy8FMqITZie7WfDd/IRiHvNDc6BePJ+vcAc2t7wbXuLj0Y6Ju+ZNYNyY9ck6XfrvL 88dw5JEJAft2YEVH3iIAAk4PwadwuhlngwxLqtQ1pOLh5/mJJEnuaZwa06iaEJN26B/m NtKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=+6nI3f9RtV/+MKWZGdObQgBIQ2b5qq2UFrnLz/a6Jm0=; b=d0TytKTLxZRjN0OAdlPvz4HAEQQdRJmuYKXRo7xJJyY4HyyvVj6Ed+YE2hEutAjq2c TuPSKt9tL1EtpApQFaxFvs1QlXhoFtw/Vgt0f7ku1/IW5Uj66YbOtqO6ImVHcAE4xE4P T7+cdo0LU8M1XxU+ZaBRfi+Zb+cgi72uZj4h4JcqkKaWZGzk1vuUKyLo5W+9vWyaPENS 5dUF1IjvJPWm/YP6P/9D189bNqMr4drKEBlkgw8Tjt5aP6ztzKZ1SCUUVG/+LJmmXKHJ gbRaV2RI/DJ/Ry78VAs4kFv6e25L4ZUw3EavvfEigUOEWKWqeC8zmGKUh2CbqdFSUs40 xSQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NwvHjzf9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r192si30558890wmd.85.2019.01.18.14.04.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 18 Jan 2019 14:04:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NwvHjzf9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:47832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkcFb-0005OY-Er for patch@linaro.org; Fri, 18 Jan 2019 17:04:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkbkd-0005Kt-Ad for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkbkb-0004ql-CF for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:31 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:36043) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkbkZ-0004iA-Nq for qemu-devel@nongnu.org; Fri, 18 Jan 2019 16:32:28 -0500 Received: by mail-pg1-x544.google.com with SMTP id n2so6649960pgm.3 for ; Fri, 18 Jan 2019 13:32:19 -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=+6nI3f9RtV/+MKWZGdObQgBIQ2b5qq2UFrnLz/a6Jm0=; b=NwvHjzf9zr9XMxtZHid0fzXnnkxE3vmzt4eNQpULZuqUfxkZfJpCMG/fU+Xm7u6R86 8QmBnlcROHm9pQBJT33GHAP20pFtFPKW28A9jhZ6p27RKIYc0PaXJ6NmrM9YMEFiEf7Y i1oaIiUsQkhyArX68V3vjTqaT5ZOQ4UPi28II= 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=+6nI3f9RtV/+MKWZGdObQgBIQ2b5qq2UFrnLz/a6Jm0=; b=r8O2QlwV1UxzT6AYHCDvcvt6ydskMlY0EljETqqsBrbsUeVbe8q0w3jlYI0jz6YHsE vVxl5mNIZlEEkzmmIrkEp9GQSVvGRo9tZ75DtV3iDg0fDcDdXpdcPdEUvXKLw4hQPcM2 p0ax94F7mOfkapDJVQjXufvDMza51Q9NLiFTt21qqz2ZnCRzSFfwQxnY9uKbUEtA1IV1 TP0D0EU8IHkRfo5Ipb3XC8ZfffNT0+RzVr/6cmV2BY5c208MgQipkwJK2g3ccIHvUmzs iwcmOgbeGE78pwOz9uJoeUmHD8WbsayyCU8I5x2XmTUUSS27jsslcFaH1os8Nhg2fVaY arnQ== X-Gm-Message-State: AJcUukcdU58a0GPl7nChpVQ2Kfs4j12Ldtf69fOnzbUu1MHtf9pKj2wf K0RdhM/RWLw+aNzngGE70bBJ7Wz52DA= X-Received: by 2002:a63:b81a:: with SMTP id p26mr19635805pge.433.1547847137041; Fri, 18 Jan 2019 13:32:17 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:32:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 19 Jan 2019 08:30:54 +1100 Message-Id: <20190118213122.22865-21-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::544 Subject: [Qemu-devel] [PATCH v6 21/49] linux-user: Split out creat 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- linux-user/syscall-defs.h | 3 +++ linux-user/strace.c | 13 ------------- linux-user/syscall-file.inc.c | 16 ++++++++++++++++ linux-user/syscall.c | 9 --------- linux-user/strace.list | 3 --- 5 files changed, 19 insertions(+), 25 deletions(-) -- 2.17.2 diff --git a/linux-user/syscall-defs.h b/linux-user/syscall-defs.h index f099d98fa3..de7a99f0c6 100644 --- a/linux-user/syscall-defs.h +++ b/linux-user/syscall-defs.h @@ -21,6 +21,9 @@ SYSCALL_DEF_FULL(brk, .impl = impl_brk, .arg_type = { ARG_PTR }); SYSCALL_DEF_ARGS(clone, ARG_CLONEFLAG, ARG_PTR, ARG_PTR, ARG_PTR, ARG_PTR); SYSCALL_DEF(close, ARG_DEC); +#ifdef TARGET_NR_creat +SYSCALL_DEF(creat, ARG_STR, ARG_MODEFLAG); +#endif SYSCALL_DEF(exit, ARG_DEC); #ifdef TARGET_NR_fork SYSCALL_DEF(fork); diff --git a/linux-user/strace.c b/linux-user/strace.c index d7847e7cd6..5cb77223fd 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1183,19 +1183,6 @@ print_clock_adjtime(const struct syscallname *name, } #endif -#ifdef TARGET_NR_creat -static void -print_creat(const struct syscallname *name, - abi_long arg0, abi_long arg1, abi_long arg2, - abi_long arg3, abi_long arg4, abi_long arg5) -{ - print_syscall_prologue(name); - print_string(arg0, 0); - print_file_mode(arg1, 1); - print_syscall_epilogue(name); -} -#endif - #ifdef TARGET_NR_execv static void print_execv(const struct syscallname *name, diff --git a/linux-user/syscall-file.inc.c b/linux-user/syscall-file.inc.c index 81423cfd64..62e1790e3b 100644 --- a/linux-user/syscall-file.inc.c +++ b/linux-user/syscall-file.inc.c @@ -24,6 +24,22 @@ SYSCALL_IMPL(close) return get_errno(close(fd)); } +#ifdef TARGET_NR_creat +SYSCALL_IMPL(creat) +{ + char *p = lock_user_string(arg1); + abi_long ret; + + if (!p) { + return -TARGET_EFAULT; + } + ret = get_errno(creat(p, arg2)); + fd_trans_unregister(ret); + unlock_user(p, arg1, 0); + return ret; +} +#endif + /* * Helpers for do_openat, manipulating /proc/self/foo. */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8da92dd188..1e9478611c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5330,15 +5330,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, void *p; switch(num) { -#ifdef TARGET_NR_creat /* not on alpha */ - case TARGET_NR_creat: - if (!(p = lock_user_string(arg1))) - return -TARGET_EFAULT; - ret = get_errno(creat(p, arg2)); - fd_trans_unregister(ret); - unlock_user(p, arg1, 0); - return ret; -#endif #ifdef TARGET_NR_link case TARGET_NR_link: { diff --git a/linux-user/strace.list b/linux-user/strace.list index afa1521e2d..be0392810c 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -94,9 +94,6 @@ #ifdef TARGET_NR_connect { TARGET_NR_connect, "connect" , "%s(%d,%#x,%d)", NULL, NULL }, #endif -#ifdef TARGET_NR_creat -{ TARGET_NR_creat, "creat" , NULL, print_creat, NULL }, -#endif #ifdef TARGET_NR_create_module { TARGET_NR_create_module, "create_module" , NULL, NULL, NULL }, #endif