From patchwork Sat Jul 2 13:56:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 555CCC43334 for ; Sat, 2 Jul 2022 13:59:06 +0000 (UTC) Received: from localhost ([::1]:55830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7deL-0000pN-4z for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 09:59:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dc4-0006cD-8S for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:44 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:40450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dc2-0000Ze-Ly for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:44 -0400 Received: by mail-il1-x130.google.com with SMTP id p9so3022691ilj.7 for ; Sat, 02 Jul 2022 06:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TrqFubMWK6vYp8ssFg9YAQd4SKhUAEjv/YEPYS2wSqs=; b=betM8XKLLnQtL5/PLcQpoO7k2wLHr1EiGZdMUL/HdwhbHLN4k93bhsVPqUWi0wRLRw WV78oxEpVPy+6K3qd91KYxG+9MOdVm7GcLuPOazobgu8DReL5utdqQhU4FZH30QJLB9H nbBm3tveczs8C+FNJfzRWLWzYxWyI3C7uNEkDsnjZgZjVRXZGn7cjM7mASMsVKusM0d9 KYLJNCt5eSopLtLREo3IeFsr+gI5JZ5SiVp/5AO7nAqussY5E0mP/DNGOIF/dbZ3GA8M tnldq7ojK5HhUKYu4mnX858SEwDwGwgabdPByW28pfSCOdz5sYNIRwHCrSLRbgHyuLyC SWYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TrqFubMWK6vYp8ssFg9YAQd4SKhUAEjv/YEPYS2wSqs=; b=75hHPIc4Uyy02/KRprrnLKBtq1bn0kk7iPgXt0CI2JZ0btDTq75sAxpgVkliRmoWnf 1Qpvxg9ssfH+0rCR05XDIhV5ltuSPK5jmmkDcw31dnKD+6rZe7bVWnd2g8Y7a3Xxzjyi FrdflRkmi2NvpAO2PAoCjU42Z/aIuEgEQmmuqNqA90WPIW1Gac2/r9DEabx7BGpqDq7J B/N7Sh8D6hyt509DRdcjdayeYwTR5WeGppTnj2h87AKHSfqfNuhTThN6BfHos5xE3Qew ZavQYLulC4uS9KWKQqSvEQXgRRo/vxXoR3hqkf2bt+xUJbBn9mnZPzJzyTO/kcsim+XP e17g== X-Gm-Message-State: AJIora+SUa2qJqWjvIac2I+imYLHTwCWOwlCgTsDvSi9H+7CrDFEH6Wj zo4vQRrkOMXy3DhlA1jta4vrybf//UfDAA== X-Google-Smtp-Source: AGRyM1sWyNggBnAXUXp0MSkdDfarnb8hWZOaShjuCX1PNw/JEw5sOArn9qsoXn11ujktAj51t6O4xg== X-Received: by 2002:a92:2a0a:0:b0:2d9:2571:f57e with SMTP id r10-20020a922a0a000000b002d92571f57emr11405854ile.154.1656770200961; Sat, 02 Jul 2022 06:56:40 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:40 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Jung-uk Kim , Richard Henderson Subject: [PULL 01/11] bsd-user: Implement mount, umount and nmount Date: Sat, 2 Jul 2022 07:56:56 -0600 Message-Id: <20220702135706.73622-2-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 52 +++++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 13 +++++++++ 2 files changed, 65 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index b2dca586129..a0f03102639 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -549,4 +549,56 @@ static abi_long do_bsd_sync(void) return 0; } +/* mount(2) */ +static abi_long do_bsd_mount(abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4) +{ + abi_long ret; + void *p1, *p2; + + LOCK_PATH2(p1, arg1, p2, arg2); + /* + * XXX arg4 should be locked, but it isn't clear how to do that since it may + * be not be a NULL-terminated string. + */ + if (arg4 == 0) { + ret = get_errno(mount(p1, p2, arg3, NULL)); /* XXX path(p2)? */ + } else { + ret = get_errno(mount(p1, p2, arg3, g2h_untagged(arg4))); /* XXX path(p2)? */ + } + UNLOCK_PATH2(p1, arg1, p2, arg2); + + return ret; +} + +/* unmount(2) */ +static abi_long do_bsd_unmount(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(unmount(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* nmount(2) */ +static abi_long do_bsd_nmount(abi_long arg1, abi_long count, + abi_long flags) +{ + abi_long ret; + struct iovec *vec = lock_iovec(VERIFY_READ, arg1, count, 1); + + if (vec != NULL) { + ret = get_errno(nmount(vec, count, flags)); + unlock_iovec(vec, arg1, count, 0); + } else { + return -TARGET_EFAULT; + } + + return ret; +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 2623caf8007..bd4dfa6ddc7 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -33,6 +33,7 @@ #include "qemu/path.h" #include #include +#include #include #include @@ -373,6 +374,18 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_sync(); break; + case TARGET_FREEBSD_NR_mount: /* mount(2) */ + ret = do_bsd_mount(arg1, arg2, arg3, arg4); + break; + + case TARGET_FREEBSD_NR_unmount: /* unmount(2) */ + ret = do_bsd_unmount(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_nmount: /* nmount(2) */ + ret = do_bsd_nmount(arg1, arg2, arg3); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:56:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904018 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F35E1C433EF for ; Sat, 2 Jul 2022 14:01:55 +0000 (UTC) Received: from localhost ([::1]:35382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7dh5-00065f-0Z for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 10:01:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dc5-0006cj-K9 for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:45 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:43965) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dc3-0000Zy-Ly for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:45 -0400 Received: by mail-io1-xd2c.google.com with SMTP id p69so4709311iod.10 for ; Sat, 02 Jul 2022 06:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7gFTuenHsOjgeoRs6av29ZkHUZxMNdZzBHc5JK4Uv6M=; b=LKKcNMqr68kvvwO6+XkF3ZpAbNw06W+U13pWkzAoAy3OqAPnNx7nW4hqUbCmTdhpsf k6brpnUREdnfp8CfQYvXZwqXEDZpG4uy/8GlnrDzTlrtNYsjm+SJ2x9h0EzfwGKkqtXR 8sM91AEspnTdAmm6VhznUOWaGko8CAZ4hcwuSaI+6Bx30D+4ajES799UN/UZ4a4hnQMV EDmF6hiryICTyNRKElVxBYVXcYRmSQKAmFmOfK5Me6fUPgSLRnaSqlM+PqcwjP/11EXN QK4RXlVu91vh7ehQTcMAXFcXkqyMx9HEurwMWFPOBPgy8i/HikDIlPNDoYsocSLPsirx WbNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7gFTuenHsOjgeoRs6av29ZkHUZxMNdZzBHc5JK4Uv6M=; b=6MOuRhN9RZrJV7mDQ0vyZ1CVehba4hHOy/HcwG3qqAgg4LH6nIJRlipggvQabU+LW2 dpTKKRkgRkJIMHE1f+pUaPA3ymjHvZ52NpF6t6Gfew6piUbkBomjYZhUtsFsmiRYdYCB AkBeuXbApxZcRxAe39ieR/Y+ZCDr6KUptx+vXIX0XmuVkdTY13P12nQ2BDF+tyBFP3Mm Smw1RoBje60gKOV4RO6GNcsKqL2pD7yJr0sIq6Bm3UQn5PQe+g75LVKkUxPKiJXELu71 rBt58QjCGjf5ZKwCesY2gRfxgyuCNZNle2DaHwKN7D85Mf3gBNV5tSqdPIbpnTQNba3t avyg== X-Gm-Message-State: AJIora/qKSrBwk+n5s6iv4oj63hF2Imu8IE1UdNbgnQg5vEdtLjdC1Ri yhu3i1i2QI8d5sW61ufCH2Kz7h1xxeQwbQ== X-Google-Smtp-Source: AGRyM1vHKxoDlmLXejgMtnur/ZbSQ5mvCps5XRO2cFJQXlG6srG0+iyTyVsnZ6c8/uLPZ+R+WtaM3A== X-Received: by 2002:a6b:b74e:0:b0:675:594e:140d with SMTP id h75-20020a6bb74e000000b00675594e140dmr10508077iof.154.1656770202306; Sat, 02 Jul 2022 06:56:42 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:41 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Jung-uk Kim , Richard Henderson Subject: [PULL 02/11] bsd-user: Implement symlink, symlinkat, readlink and readlinkat Date: Sat, 2 Jul 2022 07:56:57 -0600 Message-Id: <20220702135706.73622-3-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2c; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 74 +++++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 16 ++++++++ 2 files changed, 90 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index a0f03102639..635ac8d0e62 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -601,4 +601,78 @@ static abi_long do_bsd_nmount(abi_long arg1, abi_long count, return ret; } +/* symlink(2) */ +static abi_long do_bsd_symlink(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p1, *p2; + + LOCK_PATH2(p1, arg1, p2, arg2); + ret = get_errno(symlink(p1, p2)); /* XXX path(p1), path(p2) */ + UNLOCK_PATH2(p1, arg1, p2, arg2); + + return ret; +} + +/* symlinkat(2) */ +static abi_long do_bsd_symlinkat(abi_long arg1, abi_long arg2, + abi_long arg3) +{ + abi_long ret; + void *p1, *p2; + + LOCK_PATH2(p1, arg1, p2, arg3); + ret = get_errno(symlinkat(p1, arg2, p2)); /* XXX path(p1), path(p2) */ + UNLOCK_PATH2(p1, arg1, p2, arg3); + + return ret; +} + +/* readlink(2) */ +static abi_long do_bsd_readlink(CPUArchState *env, abi_long arg1, + abi_long arg2, abi_long arg3) +{ + abi_long ret; + void *p1, *p2; + + LOCK_PATH(p1, arg1); + p2 = lock_user(VERIFY_WRITE, arg2, arg3, 0); + if (p2 == NULL) { + UNLOCK_PATH(p1, arg1); + return -TARGET_EFAULT; + } + if (strcmp(p1, "/proc/curproc/file") == 0) { + CPUState *cpu = env_cpu(env); + TaskState *ts = (TaskState *)cpu->opaque; + strncpy(p2, ts->bprm->fullpath, arg3); + ret = MIN((abi_long)strlen(ts->bprm->fullpath), arg3); + } else { + ret = get_errno(readlink(path(p1), p2, arg3)); + } + unlock_user(p2, arg2, ret); + UNLOCK_PATH(p1, arg1); + + return ret; +} + +/* readlinkat(2) */ +static abi_long do_bsd_readlinkat(abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4) +{ + abi_long ret; + void *p1, *p2; + + LOCK_PATH(p1, arg2); + p2 = lock_user(VERIFY_WRITE, arg3, arg4, 0); + if (p2 == NULL) { + UNLOCK_PATH(p1, arg2); + return -TARGET_EFAULT; + } + ret = get_errno(readlinkat(arg1, p1, p2, arg4)); + unlock_user(p2, arg3, ret); + UNLOCK_PATH(p1, arg2); + + return ret; +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index bd4dfa6ddc7..80ec9dd4954 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -386,6 +386,22 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_nmount(arg1, arg2, arg3); break; + case TARGET_FREEBSD_NR_symlink: /* symlink(2) */ + ret = do_bsd_symlink(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_symlinkat: /* symlinkat(2) */ + ret = do_bsd_symlinkat(arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_readlink: /* readlink(2) */ + ret = do_bsd_readlink(cpu_env, arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_readlinkat: /* readlinkat(2) */ + ret = do_bsd_readlinkat(arg1, arg2, arg3, arg4); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:56:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904014 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34518C43334 for ; Sat, 2 Jul 2022 13:59:11 +0000 (UTC) Received: from localhost ([::1]:56010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7deQ-0000xG-B3 for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 09:59:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dc6-0006dm-HQ for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:46 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:45895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dc4-0000a8-VQ for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:46 -0400 Received: by mail-io1-xd35.google.com with SMTP id y2so4697625ior.12 for ; Sat, 02 Jul 2022 06:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eBqWqkQgsRng63/sJNZmq8NBH7vr2Z23dtkmb5w8maI=; b=D1qL1/jnMuEmqxflPA5UJuGRtgWaLmQvUBcq7DJGN1pj7iVNEkCh/BgFeAVexfHjiC rJ/8R+6oi2TfbvVew46mv9KlhG5JWT2l1U1NUuzYVPYkt7r7P4RWH02ViA0IfFXgfwVM 5+98tXnW/cofUzgNrV6eO1PYxHF+vfOmsVsjhqQmf0pfoqCdQaHTXYl4kQaANXuM6DFA c5fr1+X97fKPj0BrPmRd08Q5e3bGzaPJ8PK6yAV5aNdKCubigU2k2lQKcXuqdWan0qH1 RwQ6hrdwFjGWreoalNj9+Tla4auh1XYDyBERjVCQWVSJKoz8EMbQyLZyWBL1JfzMuiha +37A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eBqWqkQgsRng63/sJNZmq8NBH7vr2Z23dtkmb5w8maI=; b=D5EGmMOGzfXYEE2JZlWfp/5ZAwX/ZR9Bafe9baxrOVqHOzg7DpJaOzM/VGoqiuCbr0 k15WJ71G7puRZRSWe+rKWxepn0Tv/yS+X805zVQly5dusPi9TSharHYlLOiRDD9GX8xL fsK9azxSDoOBaYlRGwc6S+O4/Ohs0C+lwFUNfwcCSvMlWtlbxx7Is0K5bg/k4XtC4LsE AXy0oAG7hM02cgFL9sxHEjl1hDru7mIDsOpx735aiQC+3nzaUgL7qXZkg2Fh1aMYgU6D 8wvz9g5nL42Heta8YaREGafWKyDfdpwYpbNmx+tkjC+ro5lR36UPnnrzpJWUso5Z6xxe J4OQ== X-Gm-Message-State: AJIora+TFCYB+qAka5TV4wYbIRPhUOKU2ABb+a8lO2eB8axFDICH29hZ iAgZrAHLnykWvn3dcRRTTAkLA6H4ejHBAw== X-Google-Smtp-Source: AGRyM1sqlWAOojKinBw187nhHLR4x7B4Ae0KrUL6HRc59OR6M4djQDkS8ucKHyKtggrVD8BKVMVchQ== X-Received: by 2002:a02:6a1e:0:b0:331:f9b9:a920 with SMTP id l30-20020a026a1e000000b00331f9b9a920mr11163674jac.44.1656770203530; Sat, 02 Jul 2022 06:56:43 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:42 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 03/11] bsd-user: implement chmod, fchmod, lchmod and fchmodat Date: Sat, 2 Jul 2022 07:56:58 -0600 Message-Id: <20220702135706.73622-4-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 46 +++++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 16 ++++++++++++ 2 files changed, 62 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 635ac8d0e62..1af79866fc6 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -675,4 +675,50 @@ static abi_long do_bsd_readlinkat(abi_long arg1, abi_long arg2, return ret; } +/* chmod(2) */ +static abi_long do_bsd_chmod(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(chmod(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* fchmod(2) */ +static abi_long do_bsd_fchmod(abi_long arg1, abi_long arg2) +{ + return get_errno(fchmod(arg1, arg2)); +} + +/* lchmod(2) */ +static abi_long do_bsd_lchmod(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(lchmod(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* fchmodat(2) */ +static abi_long do_bsd_fchmodat(abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg2); + ret = get_errno(fchmodat(arg1, p, arg3, arg4)); + UNLOCK_PATH(p, arg2); + + return ret; +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 80ec9dd4954..b33d548a4b6 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -402,6 +402,22 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_readlinkat(arg1, arg2, arg3, arg4); break; + case TARGET_FREEBSD_NR_chmod: /* chmod(2) */ + ret = do_bsd_chmod(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fchmod: /* fchmod(2) */ + ret = do_bsd_fchmod(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_lchmod: /* lchmod(2) */ + ret = do_bsd_lchmod(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fchmodat: /* fchmodat(2) */ + ret = do_bsd_fchmodat(arg1, arg2, arg3, arg4); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:56:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0F12C43334 for ; Sat, 2 Jul 2022 14:04:48 +0000 (UTC) Received: from localhost ([::1]:41718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7djr-0001xP-Ge for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 10:04:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dc7-0006en-N8 for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:47 -0400 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]:36566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dc6-0000aO-0y for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:47 -0400 Received: by mail-il1-x12b.google.com with SMTP id h5so3037616ili.3 for ; Sat, 02 Jul 2022 06:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oR4bwx3yE4U4DhOgFewIjs/HiUDdRZ4+xHyJ70mkD7g=; b=Dv3SCmOIOKM6QPbpHXTFY8Wy0h1Qfsm3dDCGgYmx/wFtM1sIJzHQNpsZAzStpMPqLv QWh3Zt5AzC0b/O2qe0CxEswD17oyH/XCENL50ttC96CRHQiacOwWuEyglbSKchUHnyU+ mgagW4ZZxd5O4+0LArPTXtCdT+8kQQBX3Xc69zyqZHpF15Us2/SYNcrF9tZnW0Y+PC/5 eUjCvKbo1P91/FFl6FEKuY/Wi4chx7+uvKV/tvwGPP/slqpm18+laHzZiZg+9ApP+Azd eY6s2jQ1nULpeKG482XSoQSdmzgKOhTu1ukMeP1c89w6HvoSGopdVvvZes57d6ySdn3K s+eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oR4bwx3yE4U4DhOgFewIjs/HiUDdRZ4+xHyJ70mkD7g=; b=kkoV78XvSdTm6KtDqbNH4qqzbtZF3Eqc9Up8nsoqhwsyf91wiBslQH5t/ytd+H7M1Y /S31G2pqAvViFcM1H+6sWYZBIJGvO02MKWmxXnYm3YmqlH1dPOlauPotCX9VxK4u69za k7rM/esLcnrquDeSg8ptISQS4gkeWXFA5L+KEISjflFEN4NcIrMIrGxgmrBQfLdlwYHr N7s9/CGTlKzMFdTTLBh3TIRyzNVxt50euTD7K/HcGCp8pWo1XeXXC6ZwQhfzmYWJMesf RZe6a9C9irNkhBPSMaDZpDEFMxFiIRCf4b3NSG/Y4pCCUssQdO2Fo1KtWHgiDsM/+u9H PzkQ== X-Gm-Message-State: AJIora8aDwZnjJI+DZQp9r5ZK3gD6V307fPkY4kWqi3xj5IbmFEujRl6 ejY0UgDZs5AFAJOd6moqMLqojs9Y+yk0Zg== X-Google-Smtp-Source: AGRyM1u77EqKoEKH2i1bHn0cCVyLCtCgHG3yXQ+li3/CyvNfaZbU1AB6aSzCbs9wmfndTKZteZClTA== X-Received: by 2002:a92:d0a:0:b0:2d1:e698:5c4c with SMTP id 10-20020a920d0a000000b002d1e6985c4cmr11003593iln.316.1656770204673; Sat, 02 Jul 2022 06:56:44 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:44 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Michal Meloun , Richard Henderson Subject: [PULL 04/11] bsd-user: Implement freebsd11_mknod, freebsd11_mknodat and mknodat Date: Sat, 2 Jul 2022 07:56:59 -0600 Message-Id: <20220702135706.73622-5-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::12b; envelope-from=imp@bsdimp.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" These implement both the old-pre INO64 mknod variations, as well as the now current INO64 variant. Make direct syscall calls for these older syscalls to avloid too many dependencies. Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 47 +++++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 13 ++++++++++ 2 files changed, 60 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 1af79866fc6..b05d3cbb717 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -721,4 +721,51 @@ static abi_long do_bsd_fchmodat(abi_long arg1, abi_long arg2, return ret; } +/* pre-ino64 mknod(2) */ +static abi_long do_bsd_freebsd11_mknod(abi_long arg1, abi_long arg2, abi_long arg3) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(syscall(SYS_freebsd11_mknod, p, arg2, arg3)); + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* pre-ino64 mknodat(2) */ +static abi_long do_bsd_freebsd11_mknodat(abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg2); + ret = get_errno(syscall(SYS_freebsd11_mknodat, arg1, p, arg3, arg4)); + UNLOCK_PATH(p, arg2); + + return ret; +} + +/* post-ino64 mknodat(2) */ +static abi_long do_bsd_mknodat(void *cpu_env, abi_long arg1, + abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, + abi_long arg6) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg2); + /* 32-bit arch's use two 32 registers for 64 bit return value */ + if (regpairs_aligned(cpu_env) != 0) { + ret = get_errno(mknodat(arg1, p, arg3, target_arg64(arg5, arg6))); + } else { + ret = get_errno(mknodat(arg1, p, arg3, target_arg64(arg4, arg5))); + } + UNLOCK_PATH(p, arg2); + + return ret; +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index b33d548a4b6..d3125f340f7 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -32,6 +32,7 @@ #include "qemu/cutils.h" #include "qemu/path.h" #include +#include #include #include #include @@ -418,6 +419,18 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_fchmodat(arg1, arg2, arg3, arg4); break; + case TARGET_FREEBSD_NR_freebsd11_mknod: /* mknod(2) */ + ret = do_bsd_freebsd11_mknod(arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_freebsd11_mknodat: /* mknodat(2) */ + ret = do_bsd_freebsd11_mknodat(arg1, arg2, arg3, arg4); + break; + + case TARGET_FREEBSD_NR_mknodat: /* mknodat(2) */ + ret = do_bsd_mknodat(cpu_env, arg1, arg2, arg3, arg4, arg5, arg6); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:57:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98F91C433EF for ; Sat, 2 Jul 2022 13:59:12 +0000 (UTC) Received: from localhost ([::1]:56190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7deR-00014R-HW for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 09:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dc9-0006iN-EC for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:49 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]:46990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dc7-0000aZ-U6 for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:49 -0400 Received: by mail-il1-x136.google.com with SMTP id h20so3003363ilj.13 for ; Sat, 02 Jul 2022 06:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kzAzIpUIXo+c189sqZVTv1xr+Ava31F6GIsxzJh2kq4=; b=i2JNKtNKEnsCZmC+n2absR5Y4LOzNoibpH44B9nJQ0gMB1SB/tZ9ykwXVRBgjb3tc6 KaaVByd4nWmP1bYmeOGdOapNlEJY54Aq/Er9HaKBAI+eOw18kIB/NGCyAWvam/MBcZnl 1R8FzCqjeYTipIUdDhlRfCq+zsJKJLsFwZbV9kQRSTM/pDOUpdI00G57OGBUc/5bZLrq Qqd5qJvRN3HcSTi+JZL+wZQg6zAmTJaeZ0w6QBjB3JVT4QroDmgeOR+gi7H4xnb/e4Pv hWqdgtAcOvXK3RDKZhgydsF0U9G2VhOz4/DMDJblABwtYJKxY29ULgUKPONOl19505VX wUiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kzAzIpUIXo+c189sqZVTv1xr+Ava31F6GIsxzJh2kq4=; b=H4S2vytjFTeWaQJtuclmEltyhw8AIAgeicop57XdY4ir42SQ4KkY5aabzoNSr3QupL NJR77oL+P39VYa5c+5mQBPcnFQVn2cW3zXIawlus3KDuTZTVp7IcYP2X5udNt7pOTDD1 +0sBm/jVZe6WjykUZMLX57Zuk8c2/D28efVeiCp1v7LVIXQEklpSZjSgklXOfbqJaGMY gpUDYV2YirnaJiY57lPPQYtlBPlEYufVjCZ10t68BNVLblWwNtv3TOtEW2YHEqKATI7s RVC875VvZd7sk2pH/ykBBCJFBbaWWanm+ujLQ89HctByBzm+eHZgDiYixj71VT0Q7p02 qh4Q== X-Gm-Message-State: AJIora9z1Nw8FnnbC2XN24++p6+NwjoMX2eqSbuXqsKYjyMKMy0tbL4o iQGovxpleAMP9p2GRqFMG8UIHN+NZPtXXg== X-Google-Smtp-Source: AGRyM1sgrScmCLs6Sq95zwCUmFjbPheGATNeINYoYaOywwT5CwSoifaRHzt/Bdb9Yh/JBFks3wSDgQ== X-Received: by 2002:a05:6e02:214a:b0:2da:a56a:c1cf with SMTP id d10-20020a056e02214a00b002daa56ac1cfmr11698081ilv.5.1656770205546; Sat, 02 Jul 2022 06:56:45 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:44 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 05/11] bsd-user: Implement chown, fchown, lchown and fchownat Date: Sat, 2 Jul 2022 07:57:00 -0600 Message-Id: <20220702135706.73622-6-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 48 +++++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 16 ++++++++++++ 2 files changed, 64 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index b05d3cbb717..ac171c409ca 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -768,4 +768,52 @@ static abi_long do_bsd_mknodat(void *cpu_env, abi_long arg1, return ret; } +/* chown(2) */ +static abi_long do_bsd_chown(abi_long arg1, abi_long arg2, abi_long arg3) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(chown(p, arg2, arg3)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* fchown(2) */ +static abi_long do_bsd_fchown(abi_long arg1, abi_long arg2, + abi_long arg3) +{ + return get_errno(fchown(arg1, arg2, arg3)); +} + +/* lchown(2) */ +static abi_long do_bsd_lchown(abi_long arg1, abi_long arg2, + abi_long arg3) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(lchown(p, arg2, arg3)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* fchownat(2) */ +static abi_long do_bsd_fchownat(abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg2); + ret = get_errno(fchownat(arg1, p, arg3, arg4, arg5)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg2); + + return ret; +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index d3125f340f7..8090666b0d9 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -431,6 +431,22 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_mknodat(cpu_env, arg1, arg2, arg3, arg4, arg5, arg6); break; + case TARGET_FREEBSD_NR_chown: /* chown(2) */ + ret = do_bsd_chown(arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_fchown: /* fchown(2) */ + ret = do_bsd_fchown(arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_lchown: /* lchown(2) */ + ret = do_bsd_lchown(arg1, arg2, arg3); + break; + + case TARGET_FREEBSD_NR_fchownat: /* fchownat(2) */ + ret = do_bsd_fchownat(arg1, arg2, arg3, arg4, arg5); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:57:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904019 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F7EAC433EF for ; Sat, 2 Jul 2022 14:02:00 +0000 (UTC) Received: from localhost ([::1]:35566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7dh9-0006DI-MG for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 10:01:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dc9-0006jG-QJ for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:49 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:43965) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dc8-0000Zy-1d for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:49 -0400 Received: by mail-io1-xd2c.google.com with SMTP id p69so4709411iod.10 for ; Sat, 02 Jul 2022 06:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IUq6K6+TLwzMF9mxiNvWb9xoCrCozKtJXeSE/WgpCmc=; b=gWUR8bQWxA7FZLlbLMmCfHGXPu9Ecx/o/iWY/6a7u1Y3HEfnZR+wHAaYKUc8AG5sFx Ms7jb5GQDqNJ7FQI68E6jB2MWh5EJToZ9IeyqqjSEbeT9WRGqv/G99Ifs6e0q1lcp5kt SQBzFVBcK82ij+r8UUb/bRFY0hPGYBx1pXXRV30rZXtqGuetPNDUx099XMX562tquiqW Azxt9/GjnF0EIu25wMifEPNuARNEi+upigZvyJ9ykUDXWhdoVq94DvTbpQZ6R5dFwYJE 5Q9mOkmuvgSuk5NQ3s99fDyZQvI7k0xr8Mm/vGALLL0t0jQrsJzlaNMDURVLqd+PCuyJ DDZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IUq6K6+TLwzMF9mxiNvWb9xoCrCozKtJXeSE/WgpCmc=; b=RWgoS99ju031mvf4sq+qSIHaQE3ONzr2LbTscySqxogHMfH7VR7/jXuDWBOH01IprE 7fBf2QGCBGkNufjQpBp7ubtJ/U82OZMGiXhJ893PisZeUUvANpM0ekw8Ll48J9GEhOae DeSdJgItBh+hoCSdLn0jbZXytimasjeYpCcQ0oYdFk+tEpviOseCJDCkJK6MUPKS88D9 lZc6WV9A1l5lZ6y4NpF22cwU4c9uSWNXIa6eE0VNuXJ8RGtPwpo2bFIAtFnxZ2FZAMDS zUeCDgF+J+tcrb5+lzNbPPnSX2t7BWJoz+WuOCQqy/OIq8cW+8287LiyvPVFhkiQYVdA YgiA== X-Gm-Message-State: AJIora9u4oBy0W2UqKlHZm5x4vjv/cT1SVPuIMtGhktMn0xsZoWff23O CJklSKQ9qorCoR+K7yhEHm2zWFcPaTHe4w== X-Google-Smtp-Source: AGRyM1vPgI9FVbYq8oEwltwNcTKuD1vcGdluCSbfzgwxNoge5N9lp23TK2dlRo7sXOQ95EYC21sk7A== X-Received: by 2002:a05:6638:19a:b0:33c:8ce3:8346 with SMTP id a26-20020a056638019a00b0033c8ce38346mr12389207jaq.204.1656770207112; Sat, 02 Jul 2022 06:56:47 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:46 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 06/11] bsd-user: Implement chflags, lchflags and fchflags Date: Sat, 2 Jul 2022 07:57:01 -0600 Message-Id: <20220702135706.73622-7-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2c; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 32 ++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 12 ++++++++++++ 2 files changed, 44 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index ac171c409ca..a1c80428d98 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -816,4 +816,36 @@ static abi_long do_bsd_fchownat(abi_long arg1, abi_long arg2, return ret; } +/* chflags(2) */ +static abi_long do_bsd_chflags(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(chflags(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* lchflags(2) */ +static abi_long do_bsd_lchflags(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(lchflags(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* fchflags(2) */ +static abi_long do_bsd_fchflags(abi_long arg1, abi_long arg2) +{ + return get_errno(fchflags(arg1, arg2)); +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 8090666b0d9..06bc76a326b 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -447,6 +447,18 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_fchownat(arg1, arg2, arg3, arg4, arg5); break; + case TARGET_FREEBSD_NR_chflags: /* chflags(2) */ + ret = do_bsd_chflags(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_lchflags: /* lchflags(2) */ + ret = do_bsd_lchflags(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fchflags: /* fchflags(2) */ + ret = do_bsd_fchflags(arg1, arg2); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:57:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6D49C433EF for ; Sat, 2 Jul 2022 14:04:46 +0000 (UTC) Received: from localhost ([::1]:41688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7djp-0001wI-T2 for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 10:04:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dcA-0006kM-KX for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:50 -0400 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]:36863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dc9-0000at-70 for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:50 -0400 Received: by mail-io1-xd2f.google.com with SMTP id r133so4742026iod.3 for ; Sat, 02 Jul 2022 06:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k8IKafcPetXhYaW8vSA9hmiAtlGDDQQOeGPD01WxZFo=; b=7AEtCtZ9RUBuuUBz4oOZppBhV1xtBdTGDSEeAsCtYX0D2TPLvkifV0RRELWjP1MEo6 9drJFCiX32KY9ke2ZDkZNq2Xp7W3LaonV+NLUtImqZ60zi5Ii8bUHBsn53WP9393z+sB hwuJqc9SaDkQmGVKq8L493A4tr7O5siSUBoCBWKQE4fRZ838+dBV/Q7tKEMTc89w8jVx CTtnIGklq1zmlHSoUuKwM/ghe+FJuDrozaRKa5m4Ji3XCnyWuHJ44EU2JF9XO08Z5h/b xwqAOfKwDZWS8jnDc/UrkYqOar/j9zYTI8g/PSZ6oXKSe2W0c4IzInPvFysofOH9dQik 4/pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k8IKafcPetXhYaW8vSA9hmiAtlGDDQQOeGPD01WxZFo=; b=2i31XRwzF6lblVp0CadgVWikAcmwi62rQrTZqBlr2EixM9taJVY/VPGFeZqcGJeNqR IIyV9R8+Lm+a0caL3sDf71k+1hdApFfOqVwBIPlKzDtCadh/OozPGtCn4JRr2qsBf9fP tSi+UsDde4e6cC49WE5x3OflaTI9Zu010TKxG5TmqGGhiY5WBA0T33bRGW7u5iWbD8M6 Qh/8Y1spPZTxUXs8d96FP0t9s5LvYwbS/ownj9LHMWY6NC0LMhyXBPSyoKLqO1emu2o2 x5IknykB/JT+E4Wcklta+9Z8FCUIe851T6CiLXyKpfjs6Z5Mj4JZgJv91yYH2wUXZUcz G+ag== X-Gm-Message-State: AJIora9paaqrB3exkrbi+4QgZDwHX5kollbvwzE5NlL75RAtLu1GgaQj +CDNKT/I72Vcv2TMnMRKhYDuA3IPm3qjZA== X-Google-Smtp-Source: AGRyM1uDOFCk3UM8542+g38SSBBxG14bu4zFrDvZeLk7zukZmlOVdJMOiFGHzFK0haC9nRUgxRYKpA== X-Received: by 2002:a05:6638:2605:b0:332:23c3:c4be with SMTP id m5-20020a056638260500b0033223c3c4bemr12483945jat.129.1656770207904; Sat, 02 Jul 2022 06:56:47 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:47 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 07/11] bsd-user: Implement chroot and flock Date: Sat, 2 Jul 2022 07:57:02 -0600 Message-Id: <20220702135706.73622-8-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2f; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 19 +++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 8 ++++++++ 2 files changed, 27 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index a1c80428d98..c24054fed11 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -848,4 +848,23 @@ static abi_long do_bsd_fchflags(abi_long arg1, abi_long arg2) return get_errno(fchflags(arg1, arg2)); } +/* chroot(2) */ +static abi_long do_bsd_chroot(abi_long arg1) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(chroot(p)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* flock(2) */ +static abi_long do_bsd_flock(abi_long arg1, abi_long arg2) +{ + return get_errno(flock(arg1, arg2)); +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 06bc76a326b..d252fb40737 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -459,6 +459,14 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_fchflags(arg1, arg2); break; + case TARGET_FREEBSD_NR_chroot: /* chroot(2) */ + ret = do_bsd_chroot(arg1); + break; + + case TARGET_FREEBSD_NR_flock: /* flock(2) */ + ret = do_bsd_flock(arg1, arg2); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:57:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41E86C43334 for ; Sat, 2 Jul 2022 14:07:10 +0000 (UTC) Received: from localhost ([::1]:47588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7dm9-00063g-BH for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 10:07:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dcD-0006rZ-Jw for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:53 -0400 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]:33563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dcB-0000bB-3M for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:53 -0400 Received: by mail-il1-x12b.google.com with SMTP id p13so3064705ilq.0 for ; Sat, 02 Jul 2022 06:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=guUnp9hZinCJOwjoZiIYjs2izQAW1BB4o6jwqxF1ChQ=; b=symEcLE/iM3Fat/jrFRd8gDYCjnjCAcObRsN0IC71AVEdkOc3ExR7gfpePwLzaD6YP A4bM2qhnwEuNehjSDoeDx1LCraoEsoXCUJjnJeUc4mo86ALTZT5lrsOzn0JHQ4NCPSef N88qeaLgFszZdO0LuItm/9pw3Lg0L5RwciAdZ0tOUB9kcEgq7s16Ka1szA9PiLUgYRgd 1SwXOy55iYBc4PP8Ac+xBiybXJPrWSIeVXvAZEtbhttM3VX5d8XFdWgCTUkQvVJwMhz5 MOXyZqfsNu55GW93GA3+VwzEgDZtPRuFLjLXhnR2zfv8yR7FyGQ+7hEpUR+5T7vMHuxX Fbsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=guUnp9hZinCJOwjoZiIYjs2izQAW1BB4o6jwqxF1ChQ=; b=ZiHdwQKm6lLuoEiFHL35GnslfWMnz0NOeB+JheFJ/ApebrVkH5astLr+JCVzR2H576 Zr3xFzFygs7ymE4xXzUNRP0QG2EGEwDIXBiwJX99RITNQM1/0SMteB/OQMvPxAk8N26m NudS8/vvSOfGdCEtK5bjVG6kDb7luQfoSjEIN8KEntFNcZPSYxYs7qAUbifnlc42TksJ hGKSMjMoAfTF/yz889GzCDL/NfXt4NJpd2vuiwVESkzT6wdhrJoOa5ignLzZlB+K5wN2 qVJ21hTozMeomgM9pkJamjB4s0bUiXMXu5euQIibW0Qwv8B7kcUev0/iYryHCp0div/Z ZR3A== X-Gm-Message-State: AJIora8UX5PfYfGinvJ1u5q3ttUpLJAhJAfSHzIwdedazSfFg+HnrZuL HmvGF2lfmLCrWigKMkk/UQt0PzMhSPxMOA== X-Google-Smtp-Source: AGRyM1t/heXUB2TCdYvRXwOXNpAox4g3gypQklJ6Fe4Hxi6HMj+qGeDcTQ2X/SHvIhODmrKUckQr/A== X-Received: by 2002:a05:6e02:1647:b0:2d9:532c:d799 with SMTP id v7-20020a056e02164700b002d9532cd799mr10949156ilu.323.1656770208853; Sat, 02 Jul 2022 06:56:48 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:48 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 08/11] bsd-user: Implement mkfifo and mkfifoat Date: Sat, 2 Jul 2022 07:57:03 -0600 Message-Id: <20220702135706.73622-9-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::12b; envelope-from=imp@bsdimp.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 27 +++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 8 ++++++++ 2 files changed, 35 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index c24054fed11..4b2f6dcc1dc 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -867,4 +867,31 @@ static abi_long do_bsd_flock(abi_long arg1, abi_long arg2) return get_errno(flock(arg1, arg2)); } +/* mkfifo(2) */ +static abi_long do_bsd_mkfifo(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(mkfifo(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* mkfifoat(2) */ +static abi_long do_bsd_mkfifoat(abi_long arg1, abi_long arg2, + abi_long arg3) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg2); + ret = get_errno(mkfifoat(arg1, p, arg3)); + UNLOCK_PATH(p, arg2); + + return ret; +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index d252fb40737..be225195fbd 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -467,6 +467,14 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_flock(arg1, arg2); break; + case TARGET_FREEBSD_NR_mkfifo: /* mkfifo(2) */ + ret = do_bsd_mkfifo(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_mkfifoat: /* mkfifoat(2) */ + ret = do_bsd_mkfifoat(arg1, arg2, arg3); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:57:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68554C43334 for ; Sat, 2 Jul 2022 13:59:15 +0000 (UTC) Received: from localhost ([::1]:56322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7deU-00019E-9E for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 09:59:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dcC-0006pW-Id for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:52 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:36353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dcB-0000bh-1q for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:52 -0400 Received: by mail-io1-xd31.google.com with SMTP id r133so4742060iod.3 for ; Sat, 02 Jul 2022 06:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7rP1gEhSKhqMbSa+L+cwEFk3+lhmI1TzozVh4dmnW1U=; b=73hzKv9FY3sZZ6jk0oAkJcwESRAfhq3Tp5uf4FzeKkoNrx1QjXv2b13z41++OpRXSp ijFtkpxn4WU9qG5MFic/J4I1GqQqMvn3g/0fNIJtN9Tl90ahTEQGbfvwZtrm0ffOhUuK PyreLByUZMRMQllvt2F4SkUgK+9PqzlIA92JS9TRtlA2vfVoY4yIPNquF1xlPi2A32vA CRNT8jhiUpRbqCnJjr7yVb5PbdmrAWCHCQb0FJnT7zkD74NO9k4nTJG3HpEcQSETRfM6 EeUK7ZyUIpLB5FljZMXtRsb6sG/J3DcqNH4QB3Kjn92SxlsTjMpgMMPyAqZRIveRAEGp WkCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7rP1gEhSKhqMbSa+L+cwEFk3+lhmI1TzozVh4dmnW1U=; b=URWfmxQTEgh+KL1SC9KjFOOGPWanWCSd85WA1quiJ6HYe0kYMyWmFYL+7WhKZNNs5e RZ67VzJGqnTD9gP9zv9CHugW6FiKHZl+oWfLUBCO2iXzFWIPsikfei+KVzpC18R451UY g+RpQEjbaatXmjOJepJyrqs7F/37zjIGJ0qseHg1ZL9oHb58pAkHI5wPFhflSMCy2Xox 0IHAEbMCCUF/n0CjdLDbd+0+itY/2Rb+6eDGtZiyGzTxtiPJnHCiBHD2I+3WT2vCRNEs 5J4PCFsp+QzT4dyf//Jb5+q5sY090I3YzkYlw5FNKUtYhvTDrVjoJ0qPjoyNcEJXOke1 kv1A== X-Gm-Message-State: AJIora8wwtRdU24IWDqObo8/UJ1kR0gn5M57ycDlLVddTxNEe1O7Fj2C mT8+Ab/xYOIHlxVb4dvIK4rGMwc2jJ4DYQ== X-Google-Smtp-Source: AGRyM1uwl8FkHe9mmGLD6Vonfmea2igihqwhFcJNp7yuyxloopVTPnuXR4Q5bBm98FkNr+ijABijxA== X-Received: by 2002:a5e:9515:0:b0:675:454a:54d6 with SMTP id r21-20020a5e9515000000b00675454a54d6mr10270134ioj.5.1656770209844; Sat, 02 Jul 2022 06:56:49 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:49 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 09/11] bsd-user: Implement pathconf, lpathconf and fpathconf Date: Sat, 2 Jul 2022 07:57:04 -0600 Message-Id: <20220702135706.73622-10-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 32 ++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 12 ++++++++++++ 2 files changed, 44 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 4b2f6dcc1dc..065f576dfe8 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -894,4 +894,36 @@ static abi_long do_bsd_mkfifoat(abi_long arg1, abi_long arg2, return ret; } +/* pathconf(2) */ +static abi_long do_bsd_pathconf(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(pathconf(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* lpathconf(2) */ +static abi_long do_bsd_lpathconf(abi_long arg1, abi_long arg2) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(lpathconf(p, arg2)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + +/* fpathconf(2) */ +static abi_long do_bsd_fpathconf(abi_long arg1, abi_long arg2) +{ + return get_errno(fpathconf(arg1, arg2)); +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index be225195fbd..7de4c40bb16 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -475,6 +475,18 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_mkfifoat(arg1, arg2, arg3); break; + case TARGET_FREEBSD_NR_pathconf: /* pathconf(2) */ + ret = do_bsd_pathconf(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_lpathconf: /* lpathconf(2) */ + ret = do_bsd_lpathconf(arg1, arg2); + break; + + case TARGET_FREEBSD_NR_fpathconf: /* fpathconf(2) */ + ret = do_bsd_fpathconf(arg1, arg2); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:57:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D549C43334 for ; Sat, 2 Jul 2022 14:04:55 +0000 (UTC) Received: from localhost ([::1]:42036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7djy-0002DD-9X for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 10:04:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dcD-0006rc-KM for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:53 -0400 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]:39860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dcB-0000br-P1 for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:53 -0400 Received: by mail-io1-xd2f.google.com with SMTP id z191so4727961iof.6 for ; Sat, 02 Jul 2022 06:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8kkD0I+Ru5IcZB0L5eyNo83IbFVlqdLSdNar/0a50Tw=; b=Xj7y6iy+2GOiZmudhMDYDsoH3aBSrV0mul3BLjnzc1+f27K6pQDVpz1K76wHfuvn9W 7OPqCx12zi8KVS4yKBAMJgJTClmMMJ76tId2k5pd9vr4TcqAR2BucmRn2HxZuGsHcRul qs5oTMH4Fsktz7l2atacGAbLAvjNth1uwz+VR47wFnXgfqjMqDuWJBfNsYHTm2vpuN7C f9/Ks9e3T7YUOKJggsC/y7LPX0fXd1LXrBBWrbzeYNHf+ZzYJpJTz2wQon1ptH1w9Bs+ aHbZ2+M9wRbczD42+SSFE0d0IlprDVZPbtoEqNNVuXqpYMZcyo3YUGiBAPp64/e6XovT cFAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8kkD0I+Ru5IcZB0L5eyNo83IbFVlqdLSdNar/0a50Tw=; b=Gp03dzWYiZLyDzwli4AOmiCKzMJmZ7f5R7rXvl4vHLlARujIiPmO6rbSSu3W7E4vOa xhKRxTNJIvWWzOcd6PyQf1TrV6twIoJ9L94WEujrKnnm4uLy1nYCjNG0WTVfpuwSgDwl a5a4BNiRxSFmk/Po3RVYf81SKST2BAapHxrkreMvGdsUpWGYInAc+RY8H1UUSigZmYEb T2HKIRIIbH7+1KDiEPQyYV606weTdp8qF9A4UweFfGqB5fQQBZefugj5dwpuFYmyulFU k4OYfaA0SbKbbfLknfVLJaoM49sA/hoVYlhufjQd/CXejiQw5gx5VVlBvVbRk1ejeg4U mW6g== X-Gm-Message-State: AJIora+kNVGFMD75nb1GNEV5H7gzJ2/NB9A9E8mmswoJpTZNubdfICxO F9xivalQrONCPATrVCGpWCRGilm2XgBr1Q== X-Google-Smtp-Source: AGRyM1vpo3r4hI7UBS9UrRHZrUBazNVNyzjv8gWUYMRRg0e4dN191ZAZKHJiDtLlFHPX0fLcDEwgCQ== X-Received: by 2002:a05:6638:3725:b0:33c:a0d0:32d3 with SMTP id k37-20020a056638372500b0033ca0d032d3mr11962664jav.283.1656770210586; Sat, 02 Jul 2022 06:56:50 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:50 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Stacey Son , Richard Henderson Subject: [PULL 10/11] bsd-user: Implement undelete Date: Sat, 2 Jul 2022 07:57:05 -0600 Message-Id: <20220702135706.73622-11-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2f; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 13 +++++++++++++ bsd-user/freebsd/os-syscall.c | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 065f576dfe8..108a5061850 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -926,4 +926,17 @@ static abi_long do_bsd_fpathconf(abi_long arg1, abi_long arg2) return get_errno(fpathconf(arg1, arg2)); } +/* undelete(2) */ +static abi_long do_bsd_undelete(abi_long arg1) +{ + abi_long ret; + void *p; + + LOCK_PATH(p, arg1); + ret = get_errno(undelete(p)); /* XXX path(p)? */ + UNLOCK_PATH(p, arg1); + + return ret; +} + #endif /* BSD_FILE_H */ diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 7de4c40bb16..57996cad8ae 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -487,6 +487,10 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, ret = do_bsd_fpathconf(arg1, arg2); break; + case TARGET_FREEBSD_NR_undelete: /* undelete(2) */ + ret = do_bsd_undelete(arg1); + break; + default: qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num); ret = -TARGET_ENOSYS; From patchwork Sat Jul 2 13:57:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12904031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AA0AC433EF for ; Sat, 2 Jul 2022 14:10:18 +0000 (UTC) Received: from localhost ([::1]:54008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7dpB-00026B-CH for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 10:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7dcE-0006sQ-4w for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:54 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:40674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7dcC-0000c2-OV for qemu-devel@nongnu.org; Sat, 02 Jul 2022 09:56:53 -0400 Received: by mail-io1-xd35.google.com with SMTP id s17so4727870iob.7 for ; Sat, 02 Jul 2022 06:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jr2ulGcMEKrHmmAlCFEgoWkB7hLef5OTmCJlYGF3poM=; b=0YGja7Nwvit7klDaa3jfr2JaHcbIhVDlIsAdG/DrqvqZgGA/1x6Nqw7g7xP8QjHCrl Zze4SRQghje0xV9loc+G+s0L1UA7nKL1UwfF6QM0JUsokuTjTG5BB36jRFvQNz+hnBuK IIunzV3SVPafyQh10Xw/LpyUZCm4IMtZZmhJ4BFq5L9mCYseJYjDz+C7TTZCwUedtPTo /untV2fX64JDM27IpjKoourSdr52wwhfK0IOG77uKNAc0Ip/rN9UXKr1WCNh0LPqnBh7 t/bGL2mCQDwZYaWoTQ+q38vkn/x1RZYb4GCB3ljKkNSbbdFz9/w3eqYYyYrSX98r8/eV gjeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jr2ulGcMEKrHmmAlCFEgoWkB7hLef5OTmCJlYGF3poM=; b=EQPXNZU2li3RAT3r72YR/ODZglFaxF8PZ9SH3Qnlvp4keJuYj+pY5NpZ5P6365uvte 0uMAC517INDNWTE3VIhFdutXN8rg/xYl7H7n0RHDEOPzuvoPoOOllSKAMjDubtMJL83P hVedboOpqvUrEG9l52DVRGP+hbBIivcPLetTCaK/NuIVKJna0/YdEUXnTHZm4jGzimKO n3Oh0wEqmCLpXxgUMue0Hkqdta7uU8SjRctSMLG6eQHITpy/4FLOFABC6u0Xs1aiMEob ZQkHx7RFGI91Zx5ijII5qVcJH+WFtg6HmOxtwVnf/Ehpx+yfxwc5YvIul5r/HeGika2j 5unQ== X-Gm-Message-State: AJIora+H4Rdup1oFInWsSSSo9ELTNaokKP9CQqWPEbVdwP+bv/rJTvGQ Uip0/eMDLl9Pl0j4aKAZM5xEBwIGJ2bEvQ== X-Google-Smtp-Source: AGRyM1ssuoPevqOblct0KwuWRJfwYXZS++F6ZN6hJ432QCdmVYO8HsJbHHXG7oi45t4Z6VCDLQwYJw== X-Received: by 2002:a6b:6512:0:b0:674:ee9a:21fe with SMTP id z18-20020a6b6512000000b00674ee9a21femr10427488iob.168.1656770211559; Sat, 02 Jul 2022 06:56:51 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id q189-20020a6b8ec6000000b0065a47e16f4esm11584278iod.32.2022.07.02.06.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 06:56:50 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Kyle Evans , Warner Losh , Richard Henderson Subject: [PULL 11/11] bsd-user: Remove stray 'inline' from do_bsd_close Date: Sat, 2 Jul 2022 07:57:06 -0600 Message-Id: <20220702135706.73622-12-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220702135706.73622-1-imp@bsdimp.com> References: <20220702135706.73622-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" In the last series, I inadvertantly didn't remove this inline, but did all the others. Remove it for consistency. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsd-file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 108a5061850..588e0c50d45 100644 --- a/bsd-user/bsd-file.h +++ b/bsd-user/bsd-file.h @@ -252,7 +252,7 @@ static abi_long do_bsd_openat(abi_long arg1, abi_long arg2, } /* close(2) */ -static inline abi_long do_bsd_close(abi_long arg1) +static abi_long do_bsd_close(abi_long arg1) { return get_errno(close(arg1)); }