From patchwork Wed Sep 14 12:02:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 669881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sZ0ZD22svz9sRZ for ; Wed, 14 Sep 2016 22:03:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=GdJT8CQh; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=DVOjH q7Lle51I4Wb/hEg33ttb1YTWHaYrD8yynlgpNRQqLkVTpRwUy/xLX2jhTt4g/w6r KChAVZqL57EWfdx83aKYUzBjUkJmHlC/dxjOLy7DXNRQKQVXzL/tmJpv3Q/Xcj1N fZEhBVLD57YNUR0PDeRm8AZwsp/rZJdN38KV4w= 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:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=EJGAA9iOaEb kH1/mJS5ukgTGGrA=; b=GdJT8CQhgSdlTxjoBaH/Ee2Ljeu5C2MupZuLTRrgRUW OLydOv6lEzmzf9RwudJJesXR/kkWbG80CxV1rgKXG59tdxULUwcU+zAdH5id20CI pbOZbcMbMJCIHYbp70ji0fUmq3kzikeSWJDZZ/9xwFbXEW7Ta2qgFawd/2V82834 = Received: (qmail 84987 invoked by alias); 14 Sep 2016 12:03:35 -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 84880 invoked by uid 89); 14 Sep 2016 12:03:34 -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=H*r:sk:NAM01-S, H*r:104.47.32, H*r:sk:mail-sn, metcalf X-HELO: NAM01-SN1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; From: Yury Norov To: CC: Yury Norov , Arnd Bergmann Subject: [PATCH 3/4] generic/wordsize-32: don't duplicate fxstat syscall family if not needed Date: Wed, 14 Sep 2016 15:02:38 +0300 Message-ID: <1473854559-11103-4-git-send-email-ynorov@caviumnetworks.com> In-Reply-To: <1473854559-11103-1-git-send-email-ynorov@caviumnetworks.com> References: <1473854559-11103-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-ClientProxiedBy: AM2PR03CA0036.eurprd03.prod.outlook.com (10.160.207.46) To CY1PR07MB2246.namprd07.prod.outlook.com (10.164.112.148) X-MS-Office365-Filtering-Correlation-Id: 1dc103f9-2645-4067-469f-08d3dc971f7f X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2246; 2:cX5VVR5XSZvMKayiPISp/5crGy29d+l5seqfxEYMcZaWE6W8nIBYx020uH5Y13AvUiNgesG+hff3ooAwIE/zgLUIDiWVhgvd0QANP2jVzfQDMu4TJXObMSft152pITGV8kns8IKC7XfEui2KdU0mxf+wF3MtCUGaUBPQw6t1jgEvc6qNViyU2jGrifwZjHlM; 3:aETIfa7Hc5z/ny2RlbWFn4ps1chytE2LSYPqVsY22Kh/X6/k6QPmA+F49+NPtmLp+BnSxDKZjGtOna7abJYb98kbzb2XPuKMb1B8HxxGq5m4rT5jP9+9tRzAq3Pac1/Y X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR07MB2246; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2246; 25:IT0jbNy+7ABF1dtzAyP9Z+bjo4CEAcd6rWLqXq5zkzn2snHhyqQOop+aezHLfRx9dndjQa1OLvevqKJxRr5eoNdgxca5FnIRlgXd4OYcE4HW1zEv9eeKN/PCg0O5fU3CDQJy2ubXyGeK3dZtTXW6wCNJjDMKXnHdurHJoeETNzZyv6igBnHKOQ1jOkVXwDXxY1rE44igb3HoAQf+BrM5g4VqsWBpweFS2g9cBav35JJSfAYOeWsDchtVmdBFp5ZskTUyfgxnGhr514jQI6oIiQidBvyYkXUvkb799LJLlOzIu/MCEeKMO3lQLho1E35HK4AuHBhm+kixr1rC0F/CmVdyc4+xZquTzfi/wcmgDtx0RKqvFb7almYGybC1RSpjAuMIwaiWlML6omBibYbHY7cd4WjFFBeI1kLET1A3y4kvZZeVD1tcEgbexvxizvMsJUdJIHgR/zRS+8UVNyYDkKtdwevaGQt547uza6ECVJ1xekOETwgMAOiG0YnrLeOKlCZRJz0G6qAHKYXG1S/QL6wvaHnODFsjUi1gDGlqVqcRctWbIFDm1Wy9dlNOUXfxmo6DXpV82ZfWpyZ8HCnOV6GIg6pxyCawLFx4cp486yoBRY23KESmjpdQr8BDVo0yA86g079B+6QZ9iLRTdRuiHcpEXtDyhyRf9y/6dEYdIHdq+42wexjwBOZdMi+rPVWOltz+VYGijD8UMshRD7d3Nvf6EpcrhG4BwVsjiqENAhrPiHMlSFAlAlauSgBS5tTPUIVO4QVaPoLsTheZlae8NGvStwVytSZmU+giMQAmUcxH8DPJR9SEmV+do2gzK/YlPnkSzsU79376BSGfLa+ZsOh4u69fRurwfGDE9zNue0= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2246; 31:RtRpRN0NxYMFATEq5vc59cNla7BX0H8mHhxeyMBKXyzK0ViEdThWZbKkdyCnsOe/OWcLyydZN5C3seL3UpaERRxIGrHGT/EpwEMpaBpcsyPJXNgyz85gwMseKQGmdUPnxzIUSZZSFWNt2WYgCeWvPuIxGySHXnZ8ZY2ruyNc9ZeEme0BjEvbrzLaMJM43pf9NJ5wYJQ/u8+z95y8w04CbawCBDU5pXvlbjcP6wb3A8E=; 20:vYmuHW+TqVm19G8KeprgOvD0EZz3jfjhoOgjv9mCjQ2WOaaJcLRZzgunvYn56+6x1C9vb5w/ue2h9JyR3d7uuXvEtgUHGe9aJENNr2GxpDejUjmoEovWiSBy3lQ0JiTiNwW3E2G7kPuJSAy2ESX8DjOfro9J1+/knjGjS0MDDDw8C1Id/ugn/SXGLwygoPY9okCpnCWRiNK/wArv3dibLfWvPDawMLWP38NYN/w0Her6xNzvZ1zley3yd2Nf+WDzHYikoJUETjcpZqlryrSN/AQ3mMQG5dhug/mm08VOfemsJq3imyABjY8MC8hf1Xh1/47c1hed2TZVeztdzw9Iuc+cvwL+Dw+lCFGvaUf0G/yIfxR3WwW3KN9kAvDIblRIWNsaOKv0pbcLrWHu2uGJeuvFLvkzpCTWx6AQ8bKtGjAvlvYkl3GouDr5ssui4Gd9LPVnON/WAfYRo901Z72fCDo3UNU1faxbZlhLsq4cu0IyQzjnmthriBNnlLUpurxVIReDD0iXuva3B4QCnQZ4YZJzL7g6qYcv5+qeBOwq73UwKuKJbno8Iixf48qHEhX++KGNqmVLXt0aO/WnM08ibNgKpAKLpM6PfG+B0IUpCTE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY1PR07MB2246; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2246; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2246; 4:3iaoJbFSPg/FWs0sn3hLU1j+xcVVJH0jmtcIoKBGC4P544l2/sIio3Xa9XO7ovC1U1QYYixE7+mXf73ask8ePsuXLzJPQioH0NJJ52WgDH7I40R+CeGouY2TNKjlgLl0uUJ6hFHMQt3U3FWdW1xc4abAngxMjQ+ejEO2ds0aMd3poPj94mVIaibWhpfuePl2Bhb0uBlHBs4JJYtwHuu2oEVpvW8DAIsqA76VcKuLbTGmRulRf9cYcOjWGoWf9IigOjAbGLDT8076yKrHJlaIl7+nN5u4CE9KxuR7R8YLXJPz6y/73LkG2IF1pi+dieyvudofQB5st5PwozFMk6omaykY7zF6+NsVNeMuEf2XkzecwWsW/lj8gHHpF6Dg74Zm9ciTl+SC1ObQsn7cxBWlTp+R1u+k0GP3+/KpG8t35MN/y56SmYr9hkLzhuzFCmFf43V6sYih8UMMSl/vY9mv9g== X-Forefront-PRVS: 006546F32A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(377424004)(189002)(199003)(76176999)(2906002)(42186005)(229853001)(48376002)(97736004)(50466002)(189998001)(50986999)(19580405001)(6116002)(19580395003)(77096005)(15975445007)(3846002)(586003)(47776003)(66066001)(7736002)(7846002)(2351001)(105586002)(81156014)(50226002)(2950100001)(305945005)(5660300001)(4326007)(92566002)(68736007)(76506005)(8676002)(5003940100001)(81166006)(106356001)(101416001)(36756003)(110136003)(33646002)(41533002)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2246; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2246; 23:BS3qsDGFW7ntMVjuFSFo3uo2LQjBWOOeSHbAncx7a?= =?us-ascii?Q?516FcUAprlqQYuVB1N3PcMNTauZuh1+c1R5PxM4mBsr9mrdRLN2DU8SUeitG?= =?us-ascii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tafDZe/GqAhG9HgaUWuEDSVStZaKR3DwpP3xzkOTZIWgC/gfsVOx8NZtg06/MHPkZh2O/bsEME+GNuvg0z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2016 12:03:21.1755 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2246 If XSTAT_IS_XSTAT64 is enabled, there's no difference between that syscalls and their 64-bit versions. It also means that struct stat has no pads, and stat_overflow() is not needed. So we can reuse fxstat{,at}64 syscalls. There's no corresponding fstat64.c and fstatat64.c under sysdeps/unix/sysv/linux/generic/wordsize-32, so currently syscall wrappers are taken from sysdeps/unix/sysv/linux. This is not suitable for generic/wordsize-32 because redirection depending on XSTAT_IS_XSTAT64 is implemented in files that define __fxstat() and __fxstatat(). In this patch, fxstat64.c and fxstatat64.c are created under sysdeps/unix/sysv/linux/generic/wordsize-32, syscall implementations are taken from sysdeps/unix/sysv/linux, and proper redirecting is added to avoid duplication. For fxstatat64(), vers is checked against _STAT_VER_KERNEL, like in other files under generic/wordsize-32. 2016-09-14: Yury Norov * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c: don't declare __fxstat() and symbols if XSTAT_IS_XSTAT64 is enabled. * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c: don't declare __fxstatat() and symbols if XSTAT_IS_XSTAT64 is enabled. * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c: New file * sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c: New file Signed-off-by: Yury Norov --- .../unix/sysv/linux/generic/wordsize-32/fxstat.c | 2 ++ .../unix/sysv/linux/generic/wordsize-32/fxstat64.c | 31 ++++++++++++++++++++++ .../unix/sysv/linux/generic/wordsize-32/fxstatat.c | 2 ++ .../sysv/linux/generic/wordsize-32/fxstatat64.c | 31 ++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c create mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c index dd52011..ac015c0 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 +#ifndef 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 new file mode 100644 index 0000000..7df4ac0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c @@ -0,0 +1,31 @@ +/* __fxstat64 () implementation. + Copyright (C) 2011-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 + . */ + +#define __fxstat __fxstat_disable +#define _fxstat _fxstat_disable + +#include + +#undef __fxstat +#undef _fxstat +#ifdef 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..b00f65d 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 +#ifndef 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 new file mode 100644 index 0000000..8f6876a --- /dev/null +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c @@ -0,0 +1,31 @@ +/* __fxstatat64 () implementation. + Copyright (C) 2011-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 + . */ +#define __fxstatat __fxstatat_disable + +#include +#undef _STAT_VER_LINUX +#define _STAT_VER_LINUX _STAT_VER_KERNEL + +#include + +#undef __fxstatat +#ifdef XSTAT_IS_XSTAT64 +weak_alias (__fxstatat64, __fxstatat) +libc_hidden_ver (__fxstatat64, __fxstatat) +#endif