From nobody Mon Feb 9 00:31:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1603854908; cv=none; d=zohomail.com; s=zohoarc; b=juC1cobQ59ZcheboqrFyfXMb7sy+y+yo/er/yzqusxkWc5zezdKn4oEaBWv1ot4PUb8xCq66zjMii1FuZWGRNuUVMzF4mfc2TuzxYAEvQFGfxaTIiMNGb3MdM/dtw/l/BINmVSlN1zE8U7obIILrTpO7FkRA8KTZS88ISQpbUto= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603854908; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DqK0hZ8mt8LWfTZqV1hfM2y+gt2SV2gfJzd9rHBJS8g=; b=WYWtO5AYoSaflk03CMzx5dvUKkybthy3kM6yigk26o8nSWXyfu3wO3u2VbaW1ImyXSQze5iV2Ww9adi+Ua8+VUiK9L062qLggbkHvoZQy+7QABStGlsnMLOOF5FDStDi5ulUaJclLwPzJtgU3g+V688iJG4LsxvWBqHCN3XaC50= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603854908484158.92800526166036; Tue, 27 Oct 2020 20:15:08 -0700 (PDT) Received: from localhost ([::1]:46672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXbvX-0002Hd-0B for importer@patchew.org; Tue, 27 Oct 2020 23:15:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXbnw-0003qi-H8; Tue, 27 Oct 2020 23:07:16 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXbnv-0006in-1h; Tue, 27 Oct 2020 23:07:16 -0400 Received: by mail-pg1-f193.google.com with SMTP id 15so1915864pgd.12; Tue, 27 Oct 2020 20:07:14 -0700 (PDT) Received: from localhost.localdomain ([73.93.155.93]) by smtp.gmail.com with ESMTPSA id n6sm3407219pjj.34.2020.10.27.20.07.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Oct 2020 20:07:12 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=DqK0hZ8mt8LWfTZqV1hfM2y+gt2SV2gfJzd9rHBJS8g=; b=dQLneSouHcvNMRHgioM1SFJqmIyjilmd7mehshMZBkfLvqWMSNg4n/7JGrn9ECa+JK oUKvasr8Ht/2Efu2i6UUPlchrtN96893biAJufWbLRtmS1FKJ5DisuzINvfIpWTaGcyA DZOR0qruDw2z3OCmRe9Op7LdZxtRhGIPFvG/1heTOJFhTgQunpQYmJmd0o4RbnYk/AFm JrmwVzNxQvb1nT0Ue5kdoOV5vZGO9a3lhJkg7CoMH5PDT3dWSJL46xrnAnVAkEV6I++8 zAtYiN9EdTfZhJSGC2+HJVmeUB6NxxO4fdpZPiWsch6JMrr09yloSgXFNxZLwF0uwk5k 6EcQ== X-Gm-Message-State: AOAM532DR+3K4nr5I9Evq2dFvPc7IvrWmZMUsMCU4HNo+cMrVkdwkt2a HzOzD5CQWwUswAln69k3awWCJD/4agw= X-Google-Smtp-Source: ABdhPJxOdEllNjyw1vx5xWHafjR6terG8COwykwvCHLDJ+jU75WFBWbJ45JEWLpPXgEpet6FExzgWw== X-Received: by 2002:aa7:92c3:0:b029:163:d2d6:8db1 with SMTP id k3-20020aa792c30000b0290163d2d68db1mr5130208pfa.17.1603854433003; Tue, 27 Oct 2020 20:07:13 -0700 (PDT) From: Joelle van Dyne To: qemu-devel@nongnu.org Subject: [PATCH v3 7/7] block: check availablity for preadv/pwritev on mac Date: Tue, 27 Oct 2020 20:07:01 -0700 Message-Id: <20201028030701.14086-8-j@getutm.app> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201028030701.14086-1-j@getutm.app> References: <20201028030701.14086-1-j@getutm.app> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.215.193; envelope-from=osy86github@gmail.com; helo=mail-pg1-f193.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/27 23:07:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Joelle van Dyne , "open list:raw" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 5560fd20ac..b5a7ce483d 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1394,12 +1394,24 @@ static bool preadv_present =3D true; static ssize_t qemu_preadv(int fd, const struct iovec *iov, int nr_iov, off_t offset) { +#ifdef CONFIG_DARWIN /* preadv introduced in macOS 11 */ + if (!__builtin_available(macOS 11, iOS 14, watchOS 7, tvOS 14, *)) { + preadv_present =3D false; + return -ENOSYS; + } else +#endif return preadv(fd, iov, nr_iov, offset); } =20 static ssize_t qemu_pwritev(int fd, const struct iovec *iov, int nr_iov, off_t offset) { +#ifdef CONFIG_DARWIN /* pwritev introduced in macOS 11 */ + if (!__builtin_available(macOS 11, iOS 14, watchOS 7, tvOS 14, *)) { + preadv_present =3D false; + return -ENOSYS; + } else +#endif return pwritev(fd, iov, nr_iov, offset); } =20 --=20 2.28.0