From nobody Fri May 3 11:04:53 2024 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@gnu.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@gnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506818170708661.5524221698046; Sat, 30 Sep 2017 17:36:10 -0700 (PDT) Received: from localhost ([::1]:40760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dySEj-0006f5-5M for importer@patchew.org; Sat, 30 Sep 2017 20:36:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dySDp-0006AF-EW for qemu-devel@nongnu.org; Sat, 30 Sep 2017 20:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dySDl-00058k-2Z for qemu-devel@nongnu.org; Sat, 30 Sep 2017 20:35:05 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:38127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dySDk-00055I-Qa for qemu-devel@nongnu.org; Sat, 30 Sep 2017 20:35:00 -0400 Received: by mail-pg0-x242.google.com with SMTP id y192so2213868pgd.5 for ; Sat, 30 Sep 2017 17:34:57 -0700 (PDT) Received: from localhost.localdomain (c-73-189-82-67.hsd1.ca.comcast.net. [73.189.82.67]) by smtp.gmail.com with ESMTPSA id m9sm12384930pgt.49.2017.09.30.17.34.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Sep 2017 17:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wnlmJEXUK/sgSdWwRO5FgcunN/LI6AKVyR7ffa0cp8A=; b=tNhZrt+wNx+LXVrKz9oRe75ZHBWSm8oJUIzzHSWpVHxNMXFb7VT1dADE3+jRJusnHf v953bm2LFcC6x9L/K4l8X/Ogh3z35pq9bswzK5e1wHnWRfAeNUb8AqbP+ZuSHSjz40fV kuFMu3zX3GgJBbnHfifQafTBK+i+uTbbEht+PSySv71cipxacdvT/EbgqdCNfbyPCZXZ RO7nBv0MV41BWY12c1HZhwpyINdQTGMNcHrg/qQqJ9gzW/8Dbk0GAXQQUVsVB1EQjxQL /0NXoM/e+3EVsfILtou5ZynFekHa56wKM75xhl13UZsrSJYQ2P74C5hQStaCC68kzDfg oKKQ== 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:mime-version :content-transfer-encoding; bh=wnlmJEXUK/sgSdWwRO5FgcunN/LI6AKVyR7ffa0cp8A=; b=XhL7N9PeIVqBtiNwB8vDbIXI6c92KSmSDODltWsnW4WC4ZuUcSKZ6wsTlujyOE2zk5 90ujar/YXZj+qBUSp4LlU6NU0fFMSJ27AEQGxKOAbPEJVD8mueDXE8BK4g6tn0N1mcBb Qh/863s4y8UK6Kbm4F+poOSBacAM6J95H5ybhwzo3tHWgxwYhXqKqHaqS5NGbSPcYO3u hPhF3JI7zU6I8KuOh5x1UzrLwlru0b8odxGilfFabaPtWJwkogoG7O6hotRgOOu6v+k6 Ucvy7sHChJrxjK6WQ7kHM1m8QDaFWrmQWjUlJOwc3VJGT/9ksD583W6pf69V2HeJ0IfF bK2w== X-Gm-Message-State: AHPjjUi83josVDWgYo+8xz2heHlENvTJfZ34PdqKRXAVSOUhjky++l0R 6+h33QnaGvBIvOs+FwY5Fi4A2qK4Uvo= X-Google-Smtp-Source: AOwi7QDmZFwck7yWu3OUw24WJU8b/GsakrEllamckFm/JTJnLceBf6yXgO2QyjpaEmqG6mxcEQWD3g== X-Received: by 10.101.87.139 with SMTP id b11mr8831590pgr.186.1506818096467; Sat, 30 Sep 2017 17:34:56 -0700 (PDT) From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= To: qemu-devel@nongnu.org Date: Sat, 30 Sep 2017 17:34:42 -0700 Message-Id: <20171001003442.26211-1-carenas@gmail.com> X-Mailer: git-send-email 2.14.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH] linux-user: fix special case pwrite64 with count = 0 X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.com, zhuoweizhang@yahoo.com, laurent@vivier.eu, =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 building on the work from Zhuowei Zhang for making write return 0 instead of -1 when called with: write(fd, NULL, 0) Signed-off-by: Carlo Marcelo Arenas Bel=C3=B3n --- linux-user/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9b6364a266..89e883f187 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10509,6 +10509,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_lo= ng arg1, arg4 =3D arg5; arg5 =3D arg6; } + if (arg2 =3D=3D 0 && arg3 =3D=3D 0) { + ret =3D get_errno(pwrite64(arg1, NULL, arg3, target_offset64(a= rg4, arg5))); + break; + } if (!(p =3D lock_user(VERIFY_READ, arg2, arg3, 1))) goto efault; ret =3D get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, ar= g5))); --=20 2.14.2