From patchwork Mon Oct 27 07:59:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 3405 Received: (qmail 15629 invoked by alias); 27 Oct 2014 08:00:04 -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 15335 invoked by uid 89); 27 Oct 2014 08:00:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ie0-f175.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:cc:subject:date:message-id:in-reply-to :references; bh=3Fo/mU8l9DfsqfdgWviMcm8K+OhTS4Xbqih5JqCXTN0=; b=jaBZLCawggntKullRkAtNaiupHL/Un4DM8Y1VK505b8F0n1gcTlcgJ8fXuwPkeKwA5 Ot2WE8CKO1PCksC5io4vAQfkivEljzJyztGQtTx1Zan2vYMrytSDeREPEdSbldeXEaPO k1RY9YO8+qlkxNQkpFDCsSqBA+lp6IyGc19kDjt3T05rf21mUqqKq7QrR+0MAEQ8Y2NB fWrFR4ObXsN1vNnqUSAX9+6VWX0gkTFmuAD8qDcIhYMBGA+sa8BvSZ3FyhVJFUxHNJrk 7A4o6+CnXwB1q/Q+wBrqlGsyLZDLBvR42PwL6pyKPc3+KU9SqmJdw+98/y+EsjkhYHF1 KY8Q== X-Gm-Message-State: ALoCoQmsobr1gD7wP4q1VDXCui9CCUN/12PAJ0jp85LwEWk7eXm3+TBxViUKVMHK+0vRaW3NVenM X-Received: by 10.50.6.100 with SMTP id z4mr20245557igz.37.1414396798060; Mon, 27 Oct 2014 00:59:58 -0700 (PDT) From: Andrew Pinski To: libc-alpha@sourceware.org Cc: Andrew Pinski Subject: [PATCH 07/29] Allow generic stat and statfs not have padding for 32bit targets Date: Mon, 27 Oct 2014 00:59:31 -0700 Message-Id: <1414396793-9005-8-git-send-email-apinski@cavium.com> In-Reply-To: <1414396793-9005-1-git-send-email-apinski@cavium.com> References: <1414396793-9005-1-git-send-email-apinski@cavium.com> With ILP32, off_t, ino_t, blkcnt_t, fsbcnt_t, fsbfilcnt_t are all 64bit types, this allows us to use the same layout for the structure stat and statfs as LP64. So we need to remove the padding which is added for non 64bit targets. * sysdeps/unix/sysv/linux/generic/bits/stat.h (__field64): Use the 64bit version when off_t, ino_t and blkcnt_t match their 64bit version. * sysdeps/unix/sysv/linux/generic/bits/statfs.h (__field64): Use the 64bit version when fsblkcnt_t and fsfilcnt_t match their 64bit version. --- sysdeps/unix/sysv/linux/generic/bits/stat.h | 5 ++++- sysdeps/unix/sysv/linux/generic/bits/statfs.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h index faa2800..3c92184 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/stat.h +++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h @@ -42,7 +42,10 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 \ + || (defined(__OFF_T_MATCHES_OFF64_T) \ + && defined(__INO_T_MATCHES_INO64_T) \ + && defined (__BLKCNT_T_TYPE_MATCHES_BLKCNT64_T_TYPE)) # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \ diff --git a/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/sysdeps/unix/sysv/linux/generic/bits/statfs.h index e32cf76..d3bfb50 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/statfs.h +++ b/sysdeps/unix/sysv/linux/generic/bits/statfs.h @@ -34,7 +34,9 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 \ + || (defined (__FSBLKCNT_T_TYPE_MATCHES_FSBLKCNT64_T_TYPE) \ + && defined (__FSFILCNT_T_TYPE_MATCHES_FSFILCNT64_T_TYPE)) # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \