From patchwork Tue Jun 28 19:04:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 13448 Received: (qmail 41268 invoked by alias); 28 Jun 2016 19:04:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 41254 invoked by uid 89); 28 Jun 2016 19:04:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy=sk:932ec5b, H*MI:5335, H*m:5335 X-HELO: mail-qk0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=MEnG0C5mZZrN4BXnypP0amSfnyzd1EEHZfB3SGOdqvQ=; b=iPFZAsgxHNWMnBCFAf+qePmW+bUrhOfLPFtFDbnI//q0ZO/130CPsjj10X7xQ382fz tQAvfzrTWRe8mWvwry7egfOvEbaM1x/uwTtt/LMdN4ARtagnvc+j5Eq01YWbTHM7rgVE AiZgNC7wbe4LII/sioG75qRxs0amBj3nK1daiJ8qG5E1N5kGe/YLmsSxzWsFVAV354yz vLu0lXj3BM4O4OsDw0IbrIYBD5KvqEtBYFsUzfnw7kSCADH5LErqmdtOyQlNE2yTSRwd m3NuhdQZZvQo5qZseQGopBt+XWKIc+p8HTo/z5fXM4kQ+zG6gL/Pb4huRV1z0JEThuUv HWPg== X-Gm-Message-State: ALyK8tLe3xNWkdKczh4rIBh45djxnsvlttX0p9gVpEaQDm1QuHh2CHOjLuMUKNAaJzPtmIzy X-Received: by 10.13.211.6 with SMTP id v6mr1720205ywd.272.1467140659300; Tue, 28 Jun 2016 12:04:19 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/3] Remove __ASSUME_OFF_DIFF_OFF64 definition Date: Tue, 28 Jun 2016 16:04:12 -0300 Message-Id: <1467140654-5335-1-git-send-email-adhemerval.zanella@linaro.org> This patch removes the __ASSUME_OFF_DIFF_OFF64 define introduced in p{read,write} consolidation patch. This define was added based on the idea 32 bits ports would continue to follow previous off{64}_t definition where off_t size differs from off64_t one. However, with recent AArch64/ILP32 patch submission and also with discussion for RISCV kernel interface, 32 bits ports now may aim to use off_t and off64_t with the same size as 64 bits. So current assumption for both p{read,write} and p{read,write}v are not compatible with new type definition. This patch now makes the syscall wrappers to only depend on __OFF_T_MATCHES_OFF64_T to define the default and 64-suffix variant, as follow: .c #ifndef __OFF_T_MATCHES_OFF64_T /* build */ #endif and 64.c /* build 64 */ #ifdef __OFF_T_MATCHES_OFF64_T weak_alias (fallocate64, fallocate) #endif Tested on x86_64, i686, x32, and armhf. * sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_OFF_DIFF_OFF64): Remove define. * sysdeps/unix/sysv/linux/pread.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread): Replace by __OFF_T_MATCHES_OFF64_T. * sysdeps/unix/sysv/linux/pread64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread64): Likewise. * sysdeps/unix/sysv/linux/preadv.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv): Likewise. * sysdeps/unix/sysv/linux/preadv64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv64): Likewise. * sysdeps/unix/sysv/linux/pwrite.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite): Likewise. * sysdeps/unix/sysv/linux/pwrite64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite64): Likewise. * sysdeps/unix/sysv/linux/pwritev.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev): Likewise. * sysdeps/unix/sysv/linux/pwritev64.c [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev64): Likewise. --- ChangeLog | 22 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/mips/kernel-features.h | 1 - sysdeps/unix/sysv/linux/pread.c | 2 +- sysdeps/unix/sysv/linux/pread64.c | 2 +- sysdeps/unix/sysv/linux/preadv.c | 2 +- sysdeps/unix/sysv/linux/preadv64.c | 2 +- sysdeps/unix/sysv/linux/pwrite.c | 2 +- sysdeps/unix/sysv/linux/pwrite64.c | 2 +- sysdeps/unix/sysv/linux/pwritev.c | 2 +- sysdeps/unix/sysv/linux/pwritev64.c | 2 +- 10 files changed, 30 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 932ec5b..ce4471e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2016-06-28 Adhemerval Zanella + + * sysdeps/unix/sysv/linux/mips/kernel-features.h + (__ASSUME_OFF_DIFF_OFF64): Remove define. + * sysdeps/unix/sysv/linux/pread.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread): Replace by + __OFF_T_MATCHES_OFF64_T. + * sysdeps/unix/sysv/linux/pread64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread64): Likewise. + * sysdeps/unix/sysv/linux/preadv.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv): Likewise. + * sysdeps/unix/sysv/linux/preadv64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv64): Likewise. + * sysdeps/unix/sysv/linux/pwrite.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite): Likewise. + * sysdeps/unix/sysv/linux/pwrite64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite64): Likewise. + * sysdeps/unix/sysv/linux/pwritev.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev): Likewise. + * sysdeps/unix/sysv/linux/pwritev64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev64): Likewise. + 2016-06-28 Stefan Liebler [BZ #19860] diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index 09d5ece..b486d90 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -38,5 +38,4 @@ pass 64-bits values through syscalls. */ #if _MIPS_SIM == _ABIN32 # define __ASSUME_WORDSIZE64_ILP32 1 -# define __ASSUME_OFF_DIFF_OFF64 1 #endif diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c index 5663092..1bcff64 100644 --- a/sysdeps/unix/sysv/linux/pread.c +++ b/sysdeps/unix/sysv/linux/pread.c @@ -19,7 +19,7 @@ #include #include -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifndef __NR_pread # define __NR_pread __NR_pread64 diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c index c599f76..58c6aeb 100644 --- a/sysdeps/unix/sysv/linux/pread64.c +++ b/sysdeps/unix/sysv/linux/pread64.c @@ -33,7 +33,7 @@ __libc_pread64 (int fd, void *buf, size_t count, off64_t offset) weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64) -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (__libc_pread64, __libc_pread) weak_alias (__libc_pread64, __pread) weak_alias (__libc_pread64, pread) diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c index be206e2..107cb81 100644 --- a/sysdeps/unix/sysv/linux/preadv.c +++ b/sysdeps/unix/sysv/linux/preadv.c @@ -18,7 +18,7 @@ #include #include -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifdef __ASSUME_PREADV diff --git a/sysdeps/unix/sysv/linux/preadv64.c b/sysdeps/unix/sysv/linux/preadv64.c index 64164bb..66afd4c 100644 --- a/sysdeps/unix/sysv/linux/preadv64.c +++ b/sysdeps/unix/sysv/linux/preadv64.c @@ -49,6 +49,6 @@ preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) # include #endif -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (preadv64, preadv) #endif diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c index ca3014f..9c502be 100644 --- a/sysdeps/unix/sysv/linux/pwrite.c +++ b/sysdeps/unix/sysv/linux/pwrite.c @@ -19,7 +19,7 @@ #include #include -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifndef __NR_pwrite # define __NR_pwrite __NR_pwrite64 diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c index 5a37701..b49e6bc 100644 --- a/sysdeps/unix/sysv/linux/pwrite64.c +++ b/sysdeps/unix/sysv/linux/pwrite64.c @@ -33,7 +33,7 @@ weak_alias (__libc_pwrite64, __pwrite64) libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (__libc_pwrite64, __libc_pwrite) weak_alias (__libc_pwrite64, __pwrite) weak_alias (__libc_pwrite64, pwrite) diff --git a/sysdeps/unix/sysv/linux/pwritev.c b/sysdeps/unix/sysv/linux/pwritev.c index 19b4a10..6747f42 100644 --- a/sysdeps/unix/sysv/linux/pwritev.c +++ b/sysdeps/unix/sysv/linux/pwritev.c @@ -18,7 +18,7 @@ #include #include -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifdef __ASSUME_PREADV diff --git a/sysdeps/unix/sysv/linux/pwritev64.c b/sysdeps/unix/sysv/linux/pwritev64.c index c0cfe4b..e162948 100644 --- a/sysdeps/unix/sysv/linux/pwritev64.c +++ b/sysdeps/unix/sysv/linux/pwritev64.c @@ -49,6 +49,6 @@ pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset) # include #endif -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (pwritev64, pwritev) #endif