From patchwork Fri May 10 14:23:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1098082 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VjGMoKRf"; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 450ssb1gJQz9s4V for ; Sat, 11 May 2019 00:24:19 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id CB8FC102B3; Fri, 10 May 2019 16:24:14 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by helium.openadk.org (Postfix) with ESMTPS id 6D21B1015A; Fri, 10 May 2019 16:24:13 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id k18so4260950lfj.13; Fri, 10 May 2019 07:24:14 -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; bh=rQlD7ioSp0h7pIx6Lzx8IuAt7n8Kwzx7eXyx0CKffz0=; b=VjGMoKRfDpe4tEp9Dvuwd56FbPLBTKaJNdKLzvUZqw7/0JvX4MKvSBriEuBW5TpwIr MYzRJdQRE0cj4BtXY14xCAOAUY41ZXzKXOxJjrAQ7iMUEglPo/swXrrVQLKAiNVyDr/F B6hZsAuA2SdMePVjihX/JVWTEUsqC4QS3GGVcFNdrXX5tRVVVPqZ/ezBfIB5RJW5vPpH CGgdNBNnPq0wjReDwWy2tSRhR4Bp/UM2ZcQ+5bHpmTWFvOdvgxZ5QeU4N4fQUZnUfvC4 15vg6x01OBfwd4Q2XHqO7p3ghhhiPJZ3j9fjkS8HA6j/5e+7VyDsTU/mUmJeGS73II/Y ZfXw== 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; bh=rQlD7ioSp0h7pIx6Lzx8IuAt7n8Kwzx7eXyx0CKffz0=; b=id54Y4m8OoSnz4qAUeWCsYY74PbL2/z8JUlxJLncibATDIBMwCqVouFfwFdGxoCFbe t3nV50mbBgI1FtFRbbzQFK4a+1VfPpYgQdpcyNhCcKDcNF97dLxqP27K10Tl3/BukneL TxW1YJsIK5aYploHikYxY5HOaly4cN1hfTT9Zl+NUO6cAVyOl8B/8ej/5FFydwMitavZ u92LR3TIpb2G1apcNonP0HMumHKTP3BZz7iK6F3SH95vnJ1LCdORrOf5YGTkYZB2A5Dn gkuKEDT571FYvBndN1G3R8g4P486azBORc2Tj1KJvcsFkmNhBmScch6CXbQ/feb7b29w Qliw== X-Gm-Message-State: APjAAAXYLt4HBM/EOC6XEC6V7OoSPvG91J/NWiSwxmKy0gk2c71CgEiu LUEmM3uMcyw5k+sDj18YGpGRJYga X-Google-Smtp-Source: APXvYqx5AIcZj7yILmvTrVXMbxicgqm6HiX+TQMWM9plhjXfFGz8FS5IoLxnQHkwFf+oyACBDl73UA== X-Received: by 2002:a19:e34c:: with SMTP id c12mr6182530lfk.145.1557498252785; Fri, 10 May 2019 07:24:12 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net. (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id u13sm1115181lfg.71.2019.05.10.07.24.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2019 07:24:12 -0700 (PDT) From: Max Filippov To: devel@uclibc-ng.org Date: Fri, 10 May 2019 07:23:53 -0700 Message-Id: <20190510142353.1977-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 Cc: linux-xtensa@linux-xtensa.org, Chris Zankel Subject: [uclibc-ng-devel] [PATCH] preadv/pwritev: fix offset argument type X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" preadv/pwritev don't provide separate version for 64-bit wide off_t, and default to 32-bit wide off_t, which results in a mismatch between declaration and definition for user programs built with -D_FILE_OFFSET_BITS=64. Make offset argument of both functions __off64_t. This fixes test misc/tst-preadvwritev on xtensa. Signed-off-by: Max Filippov --- include/sys/uio.h | 4 ++-- libc/sysdeps/linux/common/preadv.c | 2 +- libc/sysdeps/linux/common/pwritev.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sys/uio.h b/include/sys/uio.h index aa766f9b1187..330426fec492 100644 --- a/include/sys/uio.h +++ b/include/sys/uio.h @@ -59,7 +59,7 @@ extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count); This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, - off_t __offset) __wur; + __off64_t __offset) __wur; /* Write data pointed by the buffers described by IOVEC, which is a vector of COUNT 'struct iovec's, to file descriptor FD at the given @@ -71,7 +71,7 @@ extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count, - off_t __offset) __wur; + __off64_t __offset) __wur; #endif /* Use misc. */ __END_DECLS diff --git a/libc/sysdeps/linux/common/preadv.c b/libc/sysdeps/linux/common/preadv.c index fd9dde4b999c..6a07d5df87e0 100644 --- a/libc/sysdeps/linux/common/preadv.c +++ b/libc/sysdeps/linux/common/preadv.c @@ -21,7 +21,7 @@ #ifdef __NR_preadv ssize_t -preadv (int fd, const struct iovec *vector, int count, off_t offset) +preadv (int fd, const struct iovec *vector, int count, __off64_t offset) { unsigned long pos_l, pos_h; diff --git a/libc/sysdeps/linux/common/pwritev.c b/libc/sysdeps/linux/common/pwritev.c index bef5bcf69b46..f07c40e6de3c 100644 --- a/libc/sysdeps/linux/common/pwritev.c +++ b/libc/sysdeps/linux/common/pwritev.c @@ -21,7 +21,7 @@ #ifdef __NR_pwritev ssize_t -pwritev (int fd, const struct iovec *vector, int count, off_t offset) +pwritev (int fd, const struct iovec *vector, int count, __off64_t offset) { unsigned long pos_l, pos_h;