From nobody Fri Dec 19 06:19:16 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1744791709; cv=none; d=zohomail.com; s=zohoarc; b=kaxv5ov2JXyUug7gx0qDrGm9P5e7drxJs3faLHKwXafDKopCZEPBODDe86zqQ7J7Z3Ee8qo7Wr3rDUuzX7zNdt0DDZOQ2UBPKQZJWt9qxinzCIcT+A/Vgz+jshJV6GiqP+fWayUiEZblu7aoAgHWm2pJR3jB9y64W0NyBp+ukPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744791709; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kXW9TkBOCeygIoZUCLTmx3/WoYw9rEQTC6TItKA27ak=; b=kQ7/PpKosVmoDNK7Xc5tJBNHxyyP7c2ZKS/e4EZsmOtyepu3dmLA0WvYg3wwhr1dIS3pop21C/7KwwcVIH8WlQFzUnOqzSNaXtVUMG3yqNMhXgmVhRsEbcyX2SGE6h6L3tPGRIeuLKJqUy0RHSMTx/smQN2M65pby9cvy9oUnt8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1744791709171173.00168835000682; Wed, 16 Apr 2025 01:21:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u4xzN-0005D5-1V; Wed, 16 Apr 2025 04:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4xwo-00021l-OC; Wed, 16 Apr 2025 04:16:46 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u4xwm-0005ti-5Q; Wed, 16 Apr 2025 04:16:41 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-739be717eddso5044949b3a.2; Wed, 16 Apr 2025 01:16:37 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:3b6:8b00:ee5a:e672:7d4c:d43]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73bd21c3263sm9839445b3a.38.2025.04.16.01.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 01:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744791396; x=1745396196; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kXW9TkBOCeygIoZUCLTmx3/WoYw9rEQTC6TItKA27ak=; b=SY4YoePHygCuqB5g3LPZxmx2fWWx4u5GXGqiDogVJMNwWA4RB01q5VXsHEPjaNB4pg qUCDY7z0Q9WkgKVE7x/xGI8MwO1z5gsS8ICm5/5FBtfpsQyWzLd/hSsoiTzJWQjSMo6p fJIne28AhGW2YVMPFoZkYUHHZ8jDZoT3nFChgwBxlSO6sslKogrtsIOPpPjPwRBFfgae t/Zvwf/mCVxCPmb7EKy9TWBWJ1VaLh7kKTrtiS4+drymCTE/iLiZ2/4wo4pn0C2ByKLU 66rZGeR0QA73AdbbZrQ99L0DVOUEYnm6oJVNCwpnqY0q0q7zchzFow5JKqp+4VAiJSnw 0Mtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744791396; x=1745396196; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kXW9TkBOCeygIoZUCLTmx3/WoYw9rEQTC6TItKA27ak=; b=aod21WUJNsPBV37K4rU0xZWlYcRB3WRBqbboAE2R5KLwULX6mxdWRG60ZhLQWCBzdf 0XfUOwny2lZpzZ5ogpsi+D9iBfgKVzfcGua0vlSwSDsi05z9yuV2XUILZ9evF4OrwFYs wQPcul8DIDzbjfpmHfpqUqFo3HVreBqwP0HEKaXmgK0MkLjs08WxgFgrqLCz1Pi67hTP qcqk7Yc0Gp5Aa0jR1FTDwTfGoNRvFO982RFMSSrf4wub3y6AbfUVI696y3svAvSyUmol xbPhb9dExHohrhsPE3glfau+jeMaPvmKHnCY9ah1OuIEkRnIiV0qNjf1p8PNUZqBF+Nq YqqA== X-Forwarded-Encrypted: i=1; AJvYcCUqUPnSiChDEVgMK2yaZs5lCcnotHPeT5TmBtsBaV9aLqzLmHiuZFd1IS1S6kDilQYgDT1gTUFskVx5HQ==@nongnu.org, AJvYcCUtujKF8Mj82mhUkT2nTdeiAXm7PjjCat8jJcrFv73K1VqZ4s+6re62Yagl350141RJUHAlErbRBD4JKg==@nongnu.org, AJvYcCVNiqNJk3NK+W/ifpPT5dCNGwfDcwgZDspAgNEwjH1S4kc45VYUlNQ/qHItJ8ufyCwMud4/iftm7SA=@nongnu.org, AJvYcCVpJ99hmQfpjCrO/h3o+ewb0KBeK1BbEXURdvyZU7foU9W4gTPYscrsLNxQk1jt19GxJKBFbRLvTw==@nongnu.org X-Gm-Message-State: AOJu0YynJPqySq/LjjI+PxKwQY/gnFLyoHlbWUa3uS46aLAGF3WCLK0z W/vQE3fSkUcyHPg7CH4JMoW/ymtMe8f/rlNN2bGz4G20ZpwyEJZht0cOmgyY X-Gm-Gg: ASbGncuI6/0JcMKHZI2PHNJZ8NCnqzjYBlZ+giSDhoOGIWZWS+7QQoMjNMChQsTjlBc aSFU2wLrvoTuQFLi98n8RxgXYYFL02dj5zG0EAXZUTaM5q/lzZwFh4ffGINazPmhNrMNMwZi96y AgJS2EvVFXvT7k1eFIFjsJHySZPQVwf1XgQj6ntIX6eEPvKtb4oL9ijssMO5nq40yATLod1//6D qKFfZc+owgxi3hGNQot+Hbvf4PY0jzi1tXzk4EbNdFF1XGTQnSVhGz34jmgmxhMeIOA6TSsheaE Y6Ilm4UijNBM0g+Qo7mZaChP7549a6Fwqvnj5GbwDzTPZrVotdoAq5tRww== X-Google-Smtp-Source: AGHT+IFot2Prutev9vQh238P3Y8Qu6FWMP21RaEkJWIAAcrPZLBNFGYxFnfgXEoks8g52jfCfyjKGg== X-Received: by 2002:a05:6a00:ac2:b0:736:3be3:3d77 with SMTP id d2e1a72fcca58-73c267c9faemr1430041b3a.16.1744791395895; Wed, 16 Apr 2025 01:16:35 -0700 (PDT) From: Kohei Tokunaga To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Kevin Wolf , Hanna Reitz , Kohei Tokunaga , Paolo Bonzini , Alexandre Iooss , Mahmoud Mandour , Pierrick Bouvier , Pavel Pisa , Francisco Iglesias , Vikram Garhwal , Jason Wang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Eduardo Habkost , Peter Maydell , Zhao Liu , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Richard Henderson , Ilya Leoshkevich , Stefan Hajnoczi , qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH 12/19] block: Update block to compile with Emscripten Date: Wed, 16 Apr 2025 17:14:17 +0900 Message-Id: <9da41d784991f77e2c1f38d0781cd047b593e053.1744787186.git.ktokunaga.mail@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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=2607:f8b0:4864:20::436; envelope-from=ktokunaga.mail@gmail.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1744791709775019000 Content-Type: text/plain; charset="utf-8" emscripten exposes copy_file_range declaration but doesn't provide the implementation in the final link. Define the emscripten-specific stub function to avoid type conflict with the emscripten's header. Signed-off-by: Kohei Tokunaga --- block/file-posix.c | 6 ++++++ stubs/emscripten.c | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 stubs/emscripten.c diff --git a/block/file-posix.c b/block/file-posix.c index 56d1972d15..22e0ed5069 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -110,6 +110,10 @@ #include #endif =20 +#ifdef EMSCRIPTEN +#include +#endif + /* OS X does not have O_DSYNC */ #ifndef O_DSYNC #ifdef O_SYNC @@ -2010,6 +2014,7 @@ static int handle_aiocb_write_zeroes_unmap(void *opaq= ue) return handle_aiocb_write_zeroes(aiocb); } =20 +#ifndef EMSCRIPTEN #ifndef HAVE_COPY_FILE_RANGE static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd, off_t *out_off, size_t len, unsigned int flag= s) @@ -2023,6 +2028,7 @@ static off_t copy_file_range(int in_fd, off_t *in_off= , int out_fd, #endif } #endif +#endif =20 /* * parse_zone - Fill a zone descriptor diff --git a/stubs/emscripten.c b/stubs/emscripten.c new file mode 100644 index 0000000000..2157d6349b --- /dev/null +++ b/stubs/emscripten.c @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#include "qemu/osdep.h" +/* + * emscripten exposes copy_file_range declaration but doesn't provide the + * implementation in the final link. Define the stub here but avoid type + * conflict with the emscripten's header. + */ +ssize_t copy_file_range(int in_fd, off_t *in_off, int out_fd, + off_t *out_off, size_t len, unsigned int flag= s) +{ + errno =3D ENOSYS; + return -1; +} --=20 2.25.1