From patchwork Mon Nov 21 18:07:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 83284 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1682950qge; Mon, 21 Nov 2016 10:07:50 -0800 (PST) X-Received: by 10.129.87.132 with SMTP id l126mr14655456ywb.259.1479751669750; Mon, 21 Nov 2016 10:07:49 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g20si5029326ywe.308.2016.11.21.10.07.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 10:07:49 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-74991-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-74991-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74991-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version; q=dns; s=default; b=CaqHP p0fuddIpeOYZajn5qY/KXGQy1QOt9xiOFWV5iiuuO/RlV7Xw442HeHLZaTgKj2CR pMrhTTiQj4THleBntCmaCqdccx10yGr1Hwr00q34oAvQVE2OeMuBUcTHVo7OCxLu iSCTnOwC3wJJ0XQe/DDQcH8ndpdhf09wiSDs5Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version; s=default; bh=QcR69ayRd0y OSfsuQ47ZjdiyEmU=; b=AHtiF/2C/r2YbX5ZEmUa88qWmLUQB5f2nNKegMoeiRQ Gst8J8pGR9NICjWwnj+z1/q6t2jUIv0rN82C+Nz/bihu+2OEo5D2P28A2vaVEdJ7 rRmHZrGeZTcgOf/H4uz1iuCwMjjpe/GYOAm3RQe+KnG/+b2DzkbfsUW5tUL5esAQ = Received: (qmail 112861 invoked by alias); 21 Nov 2016 18:07:39 -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 112850 invoked by uid 89); 21 Nov 2016 18:07:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HX-HELO:sk:NAM03-D, errnoh, UD:errno.h, errno.h X-HELO: NAM03-DM3-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Steve.Ellcey@cavium.com; Message-ID: <1479751640.14643.4.camel@caviumnetworks.com> Subject: Re: [PATCH] Allow [f]statfs64 to alias [f]statfs From: Steve Ellcey To: Andreas Schwab , Steve Ellcey CC: Date: Mon, 21 Nov 2016 10:07:20 -0800 In-Reply-To: References: <201611072213.uA7MDcpB020773@sellcey-lt.caveonetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: SN1PR01CA0028.prod.exchangelabs.com (10.165.224.38) To SN2PR0701MB1069.namprd07.prod.outlook.com (10.160.59.156) X-Microsoft-Exchange-Diagnostics: 1; SN2PR0701MB1069; 2:NbRrH31a7QY85Rr+PGtjOvCPcQ4AIO57JE9B4e0AHM2NVdgcxZEVRjW6HuUjquU0l9hlQXiZ+b02mBQE3gqCgqLZuY2m2dQHSM6ETZ0Gv7gH94PqGGbYjBgV1umKTiafd64ntG5P/FGeIKxjtEQZFFjv2EFlzC5Gl+C0DHGAsRM=; 3:/paPiQvDOVgN4m9G6qBby0keQSbMhKf+ACagiL7HPCvzxDw4Hi94CZVAJB0V/VM+ZwzTvzR06+Y4yNZ2ql1cFfGx6VCqqv+qIXWadwmwivZsC9KAlLgQhGsxhfXh4Nqoxz/lco3Y5Rp3Y4hStDy0easMfEpFe6IQ5c1qE4dmrEg=; 25:KsA9BRER37uM1qqisz1PbxUFTsak1o0860/uaP4odn/4etpn/f4K/ACL0mIjOZx7en/T1nQ3kBE3bbgnBI42fx7kncx/8oRi32/oiiN75K1LFdkdAhzMTSGpxBq2uv4l2BbqBHUFc0Yv8gIuWtdK292XSd5s4UuHncIxWQ4OHCvF0AvwQeYZLA3F9i5kZFPBdbwjCjltVkU7H7BwerMI4Q3Cb5WUG7UCeVtmJIbdKi9ba5gaJiB8xGwn1Ju1epFKYx4OyluDeVsRFnpRL3XjVvyVK4n9wJB+qXQcgJnN7MHzJi4WaWS9JchMuJ6yf8tqSgho7n8nr0sP1paLPtVt8eeLV8Wtji5yjLDL+xM4Q/ny6efH0C4n0RqbR0PF+HcmQy3DBBmXWjWwYNbF9PUp1XCLwFFOut0D1Epf8qSoyDdYFVTxSjpkiLgkW/k8BtaBZCcpm4cYEG0dskJxwDjojKcP5lHE6+tf7PWtzQnlWZ9pfLM5qXKjURTQZd9apKaMWaidr1ztADcd7J2avrBk7A== X-MS-Office365-Filtering-Correlation-Id: 712eb550-0b16-451f-4eaf-08d412393e91 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN2PR0701MB1069; X-Microsoft-Exchange-Diagnostics: 1; SN2PR0701MB1069; 31:MT3k86ggjzsfmf+feT/9SUeqLFrgN1Og7E+6x69CUN7ve6njio9Dn37XaskImACgrNzQB/DWNCm/ntjhGaKjHlPPK5M2rVUXtaERmmeMMOyQu+A4HUvnj1VmGhCIb/MkNQx6fN4Jv4mskBD+NEIkBVqNTfT/RPfXLZqXl9DFbfSNor24v5AMawNTJYxHVf5hSmtUsuM9hKKGrVqBs/UR+4URzL0fOccPUGR/cEp0LFQNSa5upnKdJsRDx135IgVz7xLLxWC9d0wRGrXCicYGr71Ig/SBqtjLi1/OvA3TmVjdMUWFOMjsVO7PGK3tm/Xd; 20:ipMfjLEcnSm3JTAGTI7/XI4EMpQc+uJNQujWwc9hAJcXpzokjgz+qR6BH3I3CV7VDdVC5g4AuiBNGEUrJQuFyWh5C8hNyuQTIobcy9Y3kqv3jRoHeC7JnBoGT0HoYnXcN5/L9Kz/ENXUDJZ3mM0jDRTFSX7qPG8NHSGaCfTftVYKged9kdw3ri0n3BBeokwSv9GLh9cOiLewq1JNEcTGvEboD6vr2xpw3SUTe40OZ+2Qy1gmJiM2BhWsrhOl1LH27Fc0XCi3GHpzVdRv0K1V3QDBdE9vZ/KNszfZZNi/EzQJShmEGhUEBw9yFHaOL1XUzOzTlmK6xMODWhRghWShwRSmczGuqoH3UFt2/ByA2IXrJ97Pn95VZiAw/7RY9Lss+HqoIMkK4G8BTiY/ldu1AVjI6s8E6E+8yR7J4jIWgVzSW6gMAH9htdjABj6nE+iws5P69DF1FPhWtrmVXIZ5JusOLJf0+aeIuAqayOs69oxPl7RYQcafEEA2PWBFcLR6kSXDfGFWbAG8ZLYDKIYylAr2EHL8WLEDz6w+nK+ltOIE2bdt0VLDIUcIm4SJP5jWwxYbBWTkBWRUgOzrYF+5tTJHzNQnRZWHarU+l/Zu92w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040307)(6060326)(6045199)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(6061324)(6072148)(6042181); SRVR:SN2PR0701MB1069; BCL:0; PCL:0; RULEID:; SRVR:SN2PR0701MB1069; X-Microsoft-Exchange-Diagnostics: 1; SN2PR0701MB1069; 4:zOAt6RHxE83UaFrPxYZh4iumhFTwIfOn3jQJghM7SQHcAqV0G1XmXux8oY68V9gN7Yxu4VwyM717qiHEaLHc0nqv0tg+ApgvJyFAQI2/aHIiYNWlLOgq1Pg0wtElvHLTXZdw0UxTZD7xX1f+aBMuXTEc7LYVB+5sBm9fjEDwMj3cMdJJ6ELbkMaLwkKec7Sz8ihtubPkXkkiESEQw0mrer/sP9D97Lts5bKNA/x5QebsMuCQ5OJM7GaZwTCaD4lfILV3+cTJzVQfZyo58K1z89jHumXz7hrl+0qWwXLrUQSf/4/vnsONPG8UKkt2Zy4tn2NdNP+/slDGUUC5V4dcuvdReeaYHgbb989kcIE6GeiE4puQu340GY/ULt1bwJPjRLAblhxGn9o101A5EbzU4/KfpHUobBfktDHngH0ueIyMpgD8m7z/n3HZV2lwMwTr+YKFDuepLEzN1h5oDkExtgG0b/m5aePLTPHeXnGUOUFxwCSpDyKEXq8dbBFl7UVDFXmV0z2K+fG4TQLAkIgMFIpjI2UbhNf0fthbnV5SjdQ= X-Forefront-PRVS: 01334458E5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(24454002)(377424004)(54534003)(189002)(199003)(2950100002)(6862003)(42882006)(6116002)(8676002)(50986999)(38730400001)(568964002)(103116003)(92566002)(68736007)(5890100001)(97736004)(5001770100001)(4610100001)(5660300001)(4001150100001)(105586002)(106356001)(36756003)(512874002)(69596002)(305945005)(2906002)(7736002)(77096005)(7846002)(53416004)(189998001)(2476003)(76176999)(101416001)(3846002)(33646002)(42186005)(81156014)(81166006)(84326002)(4326007)(66066001)(50226002)(229853002)(99106002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR0701MB1069; H:sellcey-lt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR0701MB1069; 23:MsZDqC3f+weBGY5RGwoD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JS6txu7V2EPqYQ19Njva5JyCIvKI0=; 24:dQ7yuZl0MDfLHq6Iw5t0jz0Ldf/9oo0/UfdgKf7eWjlWJrjHav74iUb5Mod6Iza53mEeRp7medJjFVptQnwIURQAdAAEvQ+UeuShPMLmpEk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR0701MB1069; 7:1typ1KV/gx2KoL5ojCTk62O3kCfOgnMYh6aD1jQQJb+5kNF8JQLdAnXNqdgW/IXSJwZ47nfsI1kR0S2I67WuiEIsYjJTtB+52w6U18OuoXE/38AqsP29grREl3Fqo+IhvNoGKY7uYSp6H5sJs2dfYf3aAZaoGtReE9iEFQur2L4bbIbRc3/JEARvpAhHsAitHO3TpGjDE1uCHJILyHz4Dy2wCzVk9uOcxZVe9jsUnGhro9ZJa76tyEBvTJw23eetp47IkJAcfDUJZ2Lg9xEh0L3Ypm5YJnatp2rVFvZ97EAQo/EfFRyu/jFqsSMWSzX6XlXfumHuKGiAd0j4E8ekKaELDfRLm3s2jX8xD7QBIHk= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2016 18:07:23.5476 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR0701MB1069 On Thu, 2016-11-17 at 09:53 +0100, Andreas Schwab wrote: >  > Since it is a new symbol it should follow the policy of always being > defined. > > > > > * sysdeps/unix/sysv/linux/fstatfs64.c: Make __fstatfs and > > fstatfs > > aliases of __fstatfs64 if __STATFS_IS_STATFS64 is set. > > * sysdeps/unix/sysv/linux/statfs64.c: Ditto for __statfs, statfs, > > and __statfs64. > > * sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c: Do not > > define __fstatfs and fstatfs if __STATFS_IS_STATFS64 is set. > > * sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c: Ditto > > for __statfs and statfs. > It's STATFS_IS_STATFS64, not __STATFS_IS_STATFS64. > > Andreas. Here is my updated patch, retested on x86 and aarch64.  It defines STATFS_IS_STATFS64 to 0 on all platforms, when the ILP32 aarch code is checked in it will have a new kernel_stat.h file and that will set it to 1.  I also fixed and upated the ChangeLog entry. Steve Ellcey sellcey@caviumnetworks.com 2016-11-21  Steve Ellcey   * sysdeps/unix/sysv/linux/fstatfs64.c: Hide prototypes for fstatfs and __fstatfs.  Make them aliases of __fstatfs64 if STATFS_IS_STATFS64 is set to non-zero. * sysdeps/unix/sysv/linux/statfs64.c: Ditto for __statfs, statfs, and __statfs64. * sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c: Do not define __fstatfs and fstatfs if STATFS_IS_STATFS64 is non-zero. * sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c: Ditto for __statfs and statfs. * sysdeps/unix/sysv/linux/alpha/kernel_stat.h: Set STATFS_IS_STATFS64 to 0. * sysdeps/unix/sysv/linux/generic/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/hppa/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/ia64/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/microblaze/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/mips/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h: Ditto. * sysdeps/unix/sysv/linux/x86_64/kernel_stat.h: Ditto. diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h index 6708411..d637e09 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h @@ -86,3 +86,4 @@ struct glibc21_stat }; #define XSTAT_IS_XSTAT64 1 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/fstatfs64.c b/sysdeps/unix/sysv/linux/fstatfs64.c index a624de6..a95fe18 100644 --- a/sysdeps/unix/sysv/linux/fstatfs64.c +++ b/sysdeps/unix/sysv/linux/fstatfs64.c @@ -16,9 +16,18 @@ License along with the GNU C Library; if not, see . */ +/* Hide the prototypes for __fstatfs and fstatfs so that GCC will not + complain about the different function signatures if they are aliased + to __fstat64. If STATFS_IS_STATFS64 is not zero then the statfs and + statfs64 structures have an identical layout but different type names. */ + +#define __fstatfs __fstatfs_disable +#define fstatfs fstatfs_disable + #include #include #include +#include #include #include #include @@ -70,3 +79,11 @@ __fstatfs64 (int fd, struct statfs64 *buf) #endif } weak_alias (__fstatfs64, fstatfs64) + +#undef __fstatfs +#undef fstatfs + +#if STATFS_IS_STATFS64 +weak_alias (__fstatfs64, __fstatfs) +weak_alias (__fstatfs64, fstatfs) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/kernel_stat.h b/sysdeps/unix/sysv/linux/generic/kernel_stat.h index 5d5f04b..ee9ff03 100644 --- a/sysdeps/unix/sysv/linux/generic/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/generic/kernel_stat.h @@ -26,3 +26,5 @@ #else # define XSTAT_IS_XSTAT64 0 #endif + +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c index be9599a..c199938 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c @@ -18,8 +18,10 @@ #include #include +#include #include +#if !STATFS_IS_STATFS64 #include "overflow.h" /* Return information about the filesystem on which FD resides. */ @@ -30,3 +32,4 @@ __fstatfs (int fd, struct statfs *buf) return rc ?: statfs_overflow (buf); } weak_alias (__fstatfs, fstatfs) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c index 1937f05..6413a54 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c @@ -18,8 +18,10 @@ #include #include +#include #include +#if !STATFS_IS_STATFS64 #include "overflow.h" /* Return information about the filesystem on which FILE resides. */ @@ -31,3 +33,4 @@ __statfs (const char *file, struct statfs *buf) } libc_hidden_def (__statfs) weak_alias (__statfs, statfs) +#endif diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h index 9ffa3ba..a3ac53a 100644 --- a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h @@ -31,3 +31,4 @@ struct kernel_stat { #define _HAVE_STAT64_NSEC #define XSTAT_IS_XSTAT64 0 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/ia64/kernel_stat.h b/sysdeps/unix/sysv/linux/ia64/kernel_stat.h index 2f6fbb2..9541bb5 100644 --- a/sysdeps/unix/sysv/linux/ia64/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/ia64/kernel_stat.h @@ -18,3 +18,4 @@ #define STAT_IS_KERNEL_STAT 1 #define XSTAT_IS_XSTAT64 1 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h b/sysdeps/unix/sysv/linux/kernel_stat.h index 4354d14..eecc962 100644 --- a/sysdeps/unix/sysv/linux/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/kernel_stat.h @@ -35,3 +35,4 @@ struct kernel_stat #define _HAVE_STAT64_NSEC #define XSTAT_IS_XSTAT64 0 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h index b6ae8c3..3ce58df 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h @@ -49,3 +49,4 @@ struct kernel_stat }; #define XSTAT_IS_XSTAT64 0 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h index a41d15f..388df1b 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/mips/kernel_stat.h @@ -57,3 +57,4 @@ struct kernel_stat #endif #define XSTAT_IS_XSTAT64 0 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h index 0fbde98..5b76f67 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h @@ -48,3 +48,4 @@ struct kernel_stat #define _HAVE_STAT64_NSEC #define XSTAT_IS_XSTAT64 0 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h index fce8fba..eec1ab1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel_stat.h @@ -18,3 +18,4 @@ #define STAT_IS_KERNEL_STAT 1 #define XSTAT_IS_XSTAT64 1 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h b/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h index 2f6fbb2..9541bb5 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h @@ -18,3 +18,4 @@ #define STAT_IS_KERNEL_STAT 1 #define XSTAT_IS_XSTAT64 1 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h index eb60236..a441600 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h @@ -32,3 +32,4 @@ struct kernel_stat #define _HAVE_STAT64_NSEC #define XSTAT_IS_XSTAT64 0 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h index 2a26a78..30afb55 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h @@ -45,3 +45,4 @@ struct kernel_stat64 }; #define XSTAT_IS_XSTAT64 1 +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/statfs64.c b/sysdeps/unix/sysv/linux/statfs64.c index de42261..4315fe5 100644 --- a/sysdeps/unix/sysv/linux/statfs64.c +++ b/sysdeps/unix/sysv/linux/statfs64.c @@ -16,9 +16,18 @@ License along with the GNU C Library; if not, see . */ +/* Hide the prototypes for __statfs and statfs so that GCC will not + complain about the different function signatures if they are aliased + to __stat64. If STATFS_IS_STATFS64 is not zero then the statfs and + statfs64 structures have an identical layout but different type names. */ + +#define __statfs __statfs_disable +#define statfs statfs_disable + #include #include #include +#include #include #include #include @@ -72,3 +81,12 @@ __statfs64 (const char *file, struct statfs64 *buf) #endif } weak_alias (__statfs64, statfs64) + +#undef __statfs +#undef statfs + +#if STATFS_IS_STATFS64 +weak_alias (__statfs64, __statfs) +weak_alias (__statfs64, statfs) +libc_hidden_ver (__statfs64, __statfs) +#endif diff --git a/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h b/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h index 2f6fbb2..9541bb5 100644 --- a/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/x86_64/kernel_stat.h @@ -18,3 +18,4 @@ #define STAT_IS_KERNEL_STAT 1 #define XSTAT_IS_XSTAT64 1 +#define STATFS_IS_STATFS64 0