From patchwork Mon Nov 21 19:21:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 17684 Received: (qmail 17014 invoked by alias); 21 Nov 2016 19:21:24 -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 17000 invoked by uid 89); 21 Nov 2016 19:21:23 -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=UD:stat.h, stat.h, stath, ifs X-HELO: NAM03-BY2-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Steve.Ellcey@cavium.com; Message-ID: <1479756063.14643.8.camel@caviumnetworks.com> Subject: Re: [PATCH] Use XSTAT_IS_XSTAT64 in generic xstat functions From: Steve Ellcey To: Date: Mon, 21 Nov 2016 11:21:03 -0800 In-Reply-To: <1478811993.4630.87.camel@caviumnetworks.com> References: <1478811993.4630.87.camel@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: CO2PR06CA043.namprd06.prod.outlook.com (10.141.242.43) To CO2PR0701MB1061.namprd07.prod.outlook.com (10.160.8.140) X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB1061; 2:Wv6sHMwoG6MpLQ4FWb3iIw6qVqzSn1idmzMqzuwRPN1MEFRb/krMrc4vcGxM7Inp7Wa3E9FrWbuPUJUY9W5OveZC6tu5+MXaFt2iYgaPUN1bvAWQ5TUbFQ/hm3mov4V/x/Mona1W7ua0Z6LgFG1Gm6q1vRm0Js74fnFBrwRc3rw=; 3:5l93tIRHl4zKcQ/Xn1yJkE0ZUMpqeWmEv3ctrJfNr6CLG26Zc0Cx0M9HwLOEOl8LflVb2JMECElwv2wk5+/q5lf4ezRYmiyOW6vnhy4I9JlQgJQ9p4xVeMrkYthgx/lcH8jbj7RMdsFhppAKSGMspKJzp/Rjd83QED1ipfDAYoc= X-MS-Office365-Filtering-Correlation-Id: b0a07e66-8c64-4aee-6c16-08d412438c8a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CO2PR0701MB1061; X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB1061; 25:KASd9YF+H65FoMviBU0kg2mihmDcJpCwASTMahunjlBJOufYlOQjj5Y+LBNhuZs7e9+mfqDfy+E4ER2AllObfrLlCXSGxV9B8p79HFX6+KMczPeFv3JVggP7W5Bu2kuRcHGzWT++HZtlhzUnh8o7guFQsogiVJIeec5sE6XsSezXdh2Dl/GhM80xSflRT6597CD1UZilXvF6+Hdsqg+LqaO+foWCIx8eIh2ShaBSfcRC9DrSWSuVQ2abmSRYXBfQ47/MadxHGTyZTUs3ae0pmQNfWLfM0qyEvnRALVdc1izuJJcdUGxVVYavLd7StwgYssDudHDpdD6311R5wVH310pz7ouSFADW3pfNh4FpQrAmWfOjvNKlPnIkoXQ/11eX/rsQLx4ifXoIBslhGJIwl2V0UuqS48Y5LTkSJElJp082RvvtjzPmtmuRTx3ZBDxqLEqICeD3UwFljr4kCuE1l6pBggp58vjUtSz93JxSliBxAI9B73umlejTMsj+mUQr5qZzR3teRlOUhAG5uePKpl3C8b5l+wxh2UzpFiX+gtJtucMXwrkGWcpGlpN/Sk4zTdsSigEEBYnH0bb9R3DZcwvLk+59E15hn9XCZk4xnolZsD5BHya0+KAspxIXMMmnKUlctVkCAyalM7flCceChTvfs+s4vRX/CWiscM9+J1xiDhj5eR067kXPu8OPcpHTFRB/YbeVFz3lI/uuY1wK2oJSqVqyO/Y8Yn/sLorTvAR+wsFEfDbWoBwpc3O7F2/qzPI67KRu+HbukQvanuXWsZ68EYeSjxnpyrXQiS0IekWItrHgnU7OUWV64B9oJJ/SGfRxE39MM8BH9TS+2krCSgGQyYNJwhpyNrZhGuXNpuTFTytD5uV5DJo38GVxdVWX X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB1061; 31:yO7NYRlclamzWsh6eAq6gvsb+zjmgbHbT6GFaOoc8+CZZa+RFOPSFavGsyLvPxoGBfVtnS5v6F7IEpxfZmu4/7ZbS073UWHrPFnhlBc88V/3hgtBh8b5X6cLfELCXZWK6y0uifJQxPW9kMctcy7vwC+1ds8jjCHKF96hpY6Q5MYbjGOnU2gYqIb4SAEtXwCORN8N4H1IZi7kOzrtxwZnZFu5j+FpQmVoI4bBvuszww90sRtH4AD6SSOHHtWylqEpS/oDtHHZRSqRyYEoKEvjDgEby7jDMA1TZNkw9FaWl9AwFxqJVzM6kHeKN+ocZ1/W; 20:bMwJVA1Qm40wqgTessi6UL4DTbyAyySyCURt4oHhXrl5AircNxBFtXTTqyLdKmra3ETw879f/N/SirHbILp78YepuM5rLkEFVs3JltKYgk7bGglNvNqR0wIEwk/XuccwRz2uwGQP69xlcMoOq7XnfoE1U1kz6K0qwDK+D2VE3dDcWBhIZpH6FhScBFV3mjevzcO5tqKalqtQWaFdEy0G37thHjkVTBb98P1g6f9U3gwzs/1X2shVc4xaYMHP0vnXaV3Q9qp3xSvzocvhKrfoFp32/oKlo5qWfWzPu5WTiSoss6WqyzNzn6WvaR1/dG/fPbPkUrWseHmC/HymA3J0xuzhTV8HeHyFlUl6eqTQqizKBLo63Yl3BQB+8tREqfigvigaFXHbcACJWrp9NZCCiZ57Q4QkYCJNPrkRndSxnR4IS23B3hroz7B1yUPJADHm1Jk3CQ8UJ+0S3B7ld3dbjUpnQIkHuZwxJ4BFw7gqs8qE+6mf4r0vcnPOVCepW+mfkzrB7P2gHs1NPXIVH3AAmZTv8PpcLPsNj80q0vhmgI3T9ERfKeTUFwOhnbo4V7ZeaTND5aWpHJTHcjWAHW9LltZJ3/UOsPdgFfWze38jFhc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6045199)(6040307)(6060326)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(6061324)(6042181)(6072148); SRVR:CO2PR0701MB1061; BCL:0; PCL:0; RULEID:; SRVR:CO2PR0701MB1061; X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB1061; 4:HIWfrrZSf2HSmmZFztaj3J1gi1ZiCoxSzk9d7Op7SN2KTXH+Mk2YOhM3ln5X33eyksLQs37E0LxHoWNLw84M5ADqr2eTdypk2dyj5gqUhzeg359dHwiIE/TFIeqXQBPxvA6ZU4y87znSQeV8K8iDsGoesBw/nQWshqhbpV02TUGDBkW6a8KbPNCBJ/FbOfc93u1lcVgICL469e2LRDVP/KqZO2cojDLwHrDu64FzVijFeQpq84HHQJWJaSX/R67IV67s0g3q7wHUavhgvzzSLtqjomV1frZfOn64WKiAoDEwga1oLW0EFPOqDokLiWH0eHFvZRoG0EfegVWNjS7XdCINcTSTWR7ThJncWMgSyF3sK5OIUZef4SNt2zr3bUeC+woHoGBNDB84xtKLg89TXh9BkhnlkQa/nKI05AU+8rr/bCFlgfPj32+VCau7+1eBblSkhvUNedlbJozoZ2wouXcNvRJmW1TTHtzxT0yepIm/A4gQ2Ti6TwJHCXNFvSF82Mtob9QX6qBYBYZdKAGzAg== X-Forefront-PRVS: 01334458E5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(377424004)(199003)(4610100001)(69596002)(84326002)(105586002)(107886002)(76176999)(50986999)(36756003)(189998001)(4001150100001)(81156014)(81166006)(8676002)(50226002)(7846002)(66066001)(97736004)(512874002)(103116003)(7736002)(305945005)(5890100001)(450100001)(77096005)(229853002)(5660300001)(2351001)(42882006)(68736007)(2950100002)(38730400001)(110136003)(6666003)(6916009)(92566002)(106356001)(6116002)(3846002)(2906002)(42186005)(33646002)(2476003)(53416004)(568964002)(101416001)(15760500001)(99106002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR0701MB1061; 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; CO2PR0701MB1061; 23:IcAt87YDYVgsAtUg/RPot0qvhaJN6qUL+xkFb4c?= =?us-ascii?Q?bFFyIw6H4XAuCXl3DLpqg6AlMUA80tMv83WPutRAB0FUjvbXM1F+r4sFICEp?= =?us-ascii?Q?pdffGEj41EFr4HTGzpKov9X/VhCDp3gFV2eAcIJThbpw9W9c9oseh50FSmAH?= =?us-ascii?Q?z/omNj10fmTgsuoE21g5Zf1IoPLmH6VkPDQy9TQhlk8u2AMkyq6INpjN8NSm?= =?us-ascii?Q?pLwTHlv9Tp8o6CWTZ0F+q8Ki6jtXGaKAa7AbDVkglTS5nvBWOSbrmpiSMj2R?= =?us-ascii?Q?CLiO+QafBoal6u5qD+HHsveKbgJgjTAg/tGHYInauOoe3psIAttZwkmuGCe6?= =?us-ascii?Q?jMla4yMj3iClwIMUnxQilNPsGUvYitbxbKJR4LXqeTalTU/MWzh7RFEF5C1y?= =?us-ascii?Q?LtEoLs+VjQYfsSUP+TOJPZBH4TLqAC3T1tSZjUs33LhdEXVMdKPzBTh//XMz?= =?us-ascii?Q?Z+6BVtUVFi2hpM4p7AKduNjm217V4+4fXAc5mw7RSYJVc9ervzXlrGRL8Kly?= =?us-ascii?Q?mo7/VSyZ/aVf1UdfI52fsDXPVywlDy0rOuSmePQ8b+OMXUdOHYLuWTAJy30C?= =?us-ascii?Q?/xN99B0gfYuACGcgaOqZ5htGh3gRhmscEFTE+hRM5MJnn4HYv2ubk6Gj1j5C?= =?us-ascii?Q?6D02rHJEl65PYe8Bl1Vw5CyviO76H5HrJDdMJrtWPxZxSsN+dqnMvp48X+bg?= =?us-ascii?Q?/YiQC0mFIjO5COJa6twYvaBixkhANM9VPL078O+pjAlWsWJAEDwlm6xKYu+U?= =?us-ascii?Q?oN6Ur9IRfTy0leENGDtgj8UMT5him4gV4DKeWFWa+fbFCq10FVgS8fxiyRve?= =?us-ascii?Q?nNfITRsWqNuOvYQOuWJj/bmSw7gVZYOmEAVnAe214wDGQa5JQABKCGwa5npR?= =?us-ascii?Q?wuPEBLunCvc3GXroNjiTUD6CTKC7RRZ70rdVVgC/qcF4/Wc76OefmEzxbnVm?= =?us-ascii?Q?0J3W/2Rb4kVGB6J/9SM7kUWW7axW/+PSTQKk6fCn98tm/ghs5sXBfUXBbR4V?= =?us-ascii?Q?6PPWEdeqPCXPoYBcSa0sBNQL50mvtMhpvHLtGdXnUnco9twVrMzM5aaUnUlB?= =?us-ascii?Q?rhREOcGNhRCydR7nntrdAgUKd4GAqT1mKxopTMQSSuXGO2kPFriq++mcEeeC?= =?us-ascii?Q?fK9/xLXw1zZsjRc6CI5cgNxAwgmIZs3l32i/yfS21G+wq0mfkJrMjn5RtA09?= =?us-ascii?Q?byFnlvIHCTvp1NgUGhFsGzqmhZgyX6ROLTnrhcEFBV8UlZ945mbJyrycW1x3?= =?us-ascii?Q?+np4UOw1Zrkx8eSaCc3GjJ2vWYJoYuqkplpZ3UPotqtXYhwRXVaE2dX9NNBW?= =?us-ascii?Q?7YoOH3otr9Lntn3JiBYP+ULR1xESNKtwySvD+VUUoI+thhx0n9lSwvNIUH98?= =?us-ascii?Q?dxjjKdw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB1061; 6:a43sl0SWfiuhCkqlrjtYMS/e5Gg7Yf4MLvNfaEQsxKszh3EVZPP6vnKFo1QfdnxRg9OFz3j9apAJACnBW1TH12wp/HWrxLLCUsJktBYISqw7Wj2Vc01beW7PPspUuwRB+aHSVJ69y28J0v2ljVoOfPyVBOi6+lFTOb5P64qlcQXS39EkixO1tmtuKshuoqB0rvwMSjyESJ0zVu8MsXmZbbuwKCaiMQesGv78ivfyWLDw5MnmtvlQbaohSSDS5NywiYmKoa+we+VRQDFn7+ccdRdfXY75zz+ge6+2a3PbBzjshNmnv+pt9L0RjhUrUmhMaVREaNw7egzV8ACoHdi5KDlx584zX+jkJjVFLOHa5ss=; 5:ukC79pTcYbe7VDH0SujyI8roPO6bSaRB7KR1EkFmlFAkiH3SfM8r0jzT+JGjAyWLbY7FAQpu+xWhC3+NAL1KULlaiiSmBYiPe7dksmJGUn5lx0Xij7X8zmZwtwHyhYDqgdESLKoJm6S17ja22elVhg==; 24:6LO1iYL6gPMtuLt1CHxnvpzagbIWqQtrMgORv26CRlLH/gLd6dJ+UcbhRFEuX5XahCTFw12YksFdIEffmkzrSQ/9zHxrDs7CrCd35a6d7NU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR0701MB1061; 7:b23Lxg892qvk3W0/ohtIcAL/gdjs6w+DPFIbUa8/5Tzux2o2iwqv+QyaLklyqh4qZppiiBSOuJVzgSgDUAF96kceGaHN6FNDmnEsUEnJ5cuXo5JVNnJSqYVjZzly8QlohwFXJGs04CvrdDMb4cJ5aVD8Xz2dMxdwAUgxH9ml62eCoWmTklcohRrQ3oySusWNZ5RNpN2RGfMSJoGvC3By6ASWh3Lv7lNbq6vB1efVW5bY1vYB5Qlt7dAUGpoGnKvSnYzpC0oWAKFACbO+pwtS8f2vwGI8mpzSHgsHKK1354Rq3Ey9U401r0Cvw2v2+a2aiT2Ji0inGLTOm9ehQqAXQSDlXeXWW6PbFZ/Gzqkd6iE= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2016 19:21:09.4932 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR0701MB1061 Here is a new version of my patch to use XSTAT_IS_XSTAT64 in generic 32 bit xstat routines.  This is needed for the aarch64 ILP32 work where the xstat and xstat64 routines can be aliased.  This patch uses #if's instead of #ifdef's since my earlier patch defined XSTAT_IS_XSTAT64 to 0 or 1 in all of the kernel_stat.h header files. Tested on x86 and aarch64.  OK to checkin? Steve Ellcey sellcey@caviumnetworks.com 2016-11-21  Yury Norov               Steve Ellcey           * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c: Do not define         fxstat if XSTAT_IS_XSTAT64 is set to non-zero.         * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c: Ditto for         fxstatat.         * sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c: Ditto for         lxstat.         * sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c: Ditto for xstat.         * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c: New file.         * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c: New file.         * sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c: Make __lxstat         an alias of __lxstat64 if XSTAT_IS_XSTAT64 is set to non-zero.         * sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c: Ditto for         __xstat. diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c index dd52011..0a689a8 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c @@ -25,6 +25,7 @@ #include #include +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file FD in BUF. */ @@ -43,3 +44,4 @@ __fxstat (int vers, int fd, struct stat *buf) hidden_def (__fxstat) weak_alias (__fxstat, _fxstat); +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c index e69de29..bb97a70 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c @@ -0,0 +1,36 @@ +/* __fxstat64 () implementation. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +/* Hide the prototypes for __fxstat and _fxstat so that GCC will not + complain about the different function signatures if they are aliased + to __fxstat64. If XSTAT_IS_XSTAT64 is set to non-zero then the stat and + stat64 structures have an identical layout but different type names. */ + +#define __fxstat __fxstat_disable +#define _fxstat _fxstat_disable + +#include + +#undef __fxstat +#undef _fxstat +#if XSTAT_IS_XSTAT64 +weak_alias (__fxstat64, __fxstat) +weak_alias (__fxstat64, _fxstat) +hidden_ver (__fxstat64, __fxstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c index dc7f934..aaed6db 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c @@ -26,6 +26,7 @@ #include #include +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file NAME in BUF. */ @@ -42,3 +43,4 @@ __fxstatat (int vers, int fd, const char *file, struct stat *buf, int flag) return -1; } libc_hidden_def (__fxstatat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c index e69de29..dac2ad1 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c @@ -0,0 +1,37 @@ +/* __fxstatat64 () implementation. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Chris Metcalf , 2011. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +/* Hide the prototype for __fxstatat so that GCC will not complain about + the different function signature if it is aliased to __fxstatat64. + If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64 structures + have an identical layout but different type names. */ + +#define __fxstatat __fxstatat_disable + +#include +#undef _STAT_VER_LINUX +#define _STAT_VER_LINUX _STAT_VER_KERNEL + +#include + +#undef __fxstatat +#if XSTAT_IS_XSTAT64 +weak_alias (__fxstatat64, __fxstatat) +libc_hidden_ver (__fxstatat64, __fxstatat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c index 395f98b..dd0338b 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c @@ -25,6 +25,7 @@ #include #include +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file NAME in BUF. */ @@ -41,3 +42,4 @@ __lxstat (int vers, const char *name, struct stat *buf) return -1; } hidden_def (__lxstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c index e1c15a8..7407c6b 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c @@ -16,6 +16,13 @@ License along with the GNU C Library. If not, see . */ +/* Hide the prototype for __lxstat so that GCC will not complain about + the different function signature if it is aliased to __lxstat64. + If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64 + structures have an identical layout but different type names. */ + +#define __lxstat __lxstat_disable + #include #include #include @@ -36,3 +43,9 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf) return -1; } hidden_def (__lxstat64) + +#undef __lxstat +#if XSTAT_IS_XSTAT64 +strong_alias (__lxstat64, __lxstat) +hidden_ver (__lxstat64, __lxstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c index fdd2cb0..b776e31 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c @@ -25,6 +25,7 @@ #include #include +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file NAME in BUF. */ @@ -41,3 +42,4 @@ __xstat (int vers, const char *name, struct stat *buf) return -1; } hidden_def (__xstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c index 2252337..e710931 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c @@ -16,6 +16,13 @@ License along with the GNU C Library. If not, see . */ +/* Hide the prototype for __xstat so that GCC will not complain about + the different function signature if it is aliased to __xstat64. + If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64 + structures have an identical layout but different type names. */ + +#define __xstat __xstat_disable + #include #include #include @@ -36,3 +43,9 @@ __xstat64 (int vers, const char *name, struct stat64 *buf) return -1; } hidden_def (__xstat64) + +#undef __xstat +#if XSTAT_IS_XSTAT64 +strong_alias (__xstat64, __xstat) +hidden_ver (__xstat64, __xstat) +#endif