From nobody Mon Feb 9 04:08:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529197583730845.5635586232323; Sat, 16 Jun 2018 18:06:23 -0700 (PDT) Received: from localhost ([::1]:53396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUM92-0003WB-03 for importer@patchew.org; Sat, 16 Jun 2018 21:06:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUM0V-0005iM-6L for qemu-devel@nongnu.org; Sat, 16 Jun 2018 20:57:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUM0U-0003Gp-3B for qemu-devel@nongnu.org; Sat, 16 Jun 2018 20:57:27 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:32913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUM0T-0003Gi-UP for qemu-devel@nongnu.org; Sat, 16 Jun 2018 20:57:26 -0400 Received: by mail-qt0-x244.google.com with SMTP id l10-v6so12414206qtj.0 for ; Sat, 16 Jun 2018 17:57:25 -0700 (PDT) Received: from localhost.localdomain (96-86-104-61-static.hfc.comcastbusiness.net. [96.86.104.61]) by smtp.gmail.com with ESMTPSA id x21-v6sm7302186qto.2.2018.06.16.17.57.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Jun 2018 17:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juliacomputing-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=a39E3ASG8sy/zL/I8k/4+p165bB01iLXVFh9FxOdrh8=; b=c3dXaFQ734yUkySnr4NtXgvRl06MlKrtd6FePX2/Z4ZvzatwBBuK4cV8ujAduiJBGL nXpzeHB+q1k+Fdlntwy9SGLov191OE7XNVD29NhdL2C3Ezq7W7PzvoSyKVt2LPGR2vMY FMBnUTJEw0N0IxCIwiRsw/f5uH41ZodTwyocos/ANZ0uLl+aH1o3xj2EQbP6cPH9MKcx j2WOknoJyA91p5xrMRiaLeRqQIoZvt3UFVIeBUSkqHrCISzG9WMhnp1y8HjBRRKg9ysJ aZ0NG2UTXlaJmegTqor+3anSJwWZv3digfBeuEFdHpZ2LUeSB2XJDF1htOvVqACU09dT +NzQ== 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:in-reply-to:references; bh=a39E3ASG8sy/zL/I8k/4+p165bB01iLXVFh9FxOdrh8=; b=CNrI7aWjuYpSfRzvyAJwVoRdvB74v0Ie0/nE+UFM8am0rVDYF1F0QfboTZH/MOAGbs Jg5AzaPsNHRkv9eAAadE85AehL0fXBPE1NUwi9umtZDoZH/YZcuTikZlO6EVfJEL0VfY Ozh6CpHHRr9Wt48qVopgm3gvQ8H+/hqe8Ww7Z7StFHUMKbhc1ZuDpS7Lguwk5jTHCZiS EghFqdlglMfIvzIYmHLni6s3JKuEM+JYm92DLznAUNKhs3QQ1u2VZb0rY8OLhmSYzEzJ iVTsAl/uiVJ4RigMp+AQUu1vvy066CQqsfjHi51PSxYjPCCQ1Wor46q0PXb1rQnVJ6wv 0hPQ== X-Gm-Message-State: APt69E1mAk13B9lOKsCcoipuaEiynvBw8w1b/RCLnNpB+jD5NofbOz7k Infh1K/zmW0BAHXBMQ+c9/txRuN34Ls= X-Google-Smtp-Source: ADUXVKIRfgMX+voGCxWGCxWkbHvx4Gqe9uilqtqbbBY9yatAsBhozOZoTgUQgj8VPvtEmuWVtZHSPw== X-Received: by 2002:ac8:65d1:: with SMTP id t17-v6mr6723933qto.347.1529197045155; Sat, 16 Jun 2018 17:57:25 -0700 (PDT) From: Keno Fischer To: qemu-devel@nongnu.org Date: Sat, 16 Jun 2018 20:56:52 -0400 Message-Id: X-Mailer: git-send-email 2.8.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v3 08/13] 9p: darwin: *xattr_nofollow implementations 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: Keno Fischer , groug@kaod.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This implements the darwin equivalent of the functions that were moved to 9p-util(-linux) earlier in this series in the new 9p-util-darwin file. Signed-off-by: Keno Fischer --- hw/9pfs/9p-util-darwin.c | 64 ++++++++++++++++++++++++++++++++++++++++++++= ++++ hw/9pfs/Makefile.objs | 1 + 2 files changed, 65 insertions(+) create mode 100644 hw/9pfs/9p-util-darwin.c diff --git a/hw/9pfs/9p-util-darwin.c b/hw/9pfs/9p-util-darwin.c new file mode 100644 index 0000000..cdb4c9e --- /dev/null +++ b/hw/9pfs/9p-util-darwin.c @@ -0,0 +1,64 @@ +/* + * 9p utilities (Darwin Implementation) + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/xattr.h" +#include "9p-util.h" + +ssize_t fgetxattrat_nofollow(int dirfd, const char *filename, const char *= name, + void *value, size_t size) +{ + int ret; + int fd =3D openat_file(dirfd, filename, + O_RDONLY | O_PATH_9P_UTIL | O_NOFOLLOW, 0); + if (fd =3D=3D -1) { + return -1; + } + ret =3D fgetxattr(fd, name, value, size, 0, 0); + close_preserve_errno(fd); + return ret; +} + +ssize_t flistxattrat_nofollow(int dirfd, const char *filename, + char *list, size_t size) +{ + int ret; + int fd =3D openat_file(dirfd, filename, + O_RDONLY | O_PATH_9P_UTIL | O_NOFOLLOW, 0); + if (fd =3D=3D -1) { + return -1; + } + ret =3D flistxattr(fd, list, size, 0); + close_preserve_errno(fd); + return ret; +} + +ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, + const char *name) +{ + int ret; + int fd =3D openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0= ); + if (fd =3D=3D -1) { + return -1; + } + ret =3D fremovexattr(fd, name, 0); + close_preserve_errno(fd); + return ret; +} + +int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name, + void *value, size_t size, int flags) +{ + int ret; + int fd =3D openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0= ); + if (fd =3D=3D -1) { + return -1; + } + ret =3D fsetxattr(fd, name, value, size, 0, flags); + close_preserve_errno(fd); + return ret; +} diff --git a/hw/9pfs/Makefile.objs b/hw/9pfs/Makefile.objs index 95e3bc0..0de39af 100644 --- a/hw/9pfs/Makefile.objs +++ b/hw/9pfs/Makefile.objs @@ -1,6 +1,7 @@ ifeq ($(call lor,$(CONFIG_VIRTIO_9P),$(CONFIG_XEN)),y) common-obj-y =3D 9p.o common-obj-$(CONFIG_LINUX) +=3D 9p-util-linux.o +common-obj-$(CONFIG_DARWIN) +=3D 9p-util-darwin.o common-obj-y +=3D 9p-local.o 9p-xattr.o common-obj-y +=3D 9p-xattr-user.o 9p-posix-acl.o common-obj-y +=3D coth.o cofs.o codir.o cofile.o --=20 2.8.1