From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93145 invoked by alias); 16 Nov 2016 13:16:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 93115 invoked by uid 89); 16 Nov 2016 13:16:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy=__access, UD:fcntl.h, fcntlh, checkin X-HELO: mail-qk0-f174.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=PvBVCdNLfxe0L8pNWmIQnhgpb1iG0x3CyXxxFXQFjv4=; b=PRY5X+Ro+cIeKtdnSRCrXDpn7lVz28Rm9sD7WbmdM/5MpYvOoEE415ZPgJIx8QE24R d80v0EyrA1yDow+T7RYjMPSrqwwUDKYkkUwOmuNy+Cw0vafqzv/n80LogE88apsriShQ PWXyH4YPnNK3u54y+8mqW5jqajiDjaiQgLg/giP+xiCXgA0Seit9nlzIj1qPmebhYMT2 /PFxEgMmd0V7wpQmJZd8wiVUT50LUNda9q9sX5c01lbQC386tKTYtilBRyfAtiT87r/E sjptA9jkdVYDhZFaP+FiNTUzOBwzQvL+kZVjbhU1AtFk+Tw/HWXZw1UdL0sk1hsyFpWM 0xyQ== X-Gm-Message-State: AKaTC02pxv0uvEVuApLUNALtX37aHFRbFOF5jA2QzUxCg6uOSsHUk6JJK/+UtXl9Q4naNKa2 X-Received: by 10.55.8.136 with SMTP id 130mr3515432qki.74.1479302198381; Wed, 16 Nov 2016 05:16:38 -0800 (PST) Subject: Re: [PATCH 1/2] Consolidate Linux access implementation To: Adhemerval Zanella , libc-alpha@sourceware.org References: <1478797446-12213-1-git-send-email-adhemerval.zanella@linaro.org> From: Carlos O'Donell Message-ID: Date: Wed, 16 Nov 2016 13:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478797446-12213-1-git-send-email-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00543.txt.bz2 On 11/10/2016 12:04 PM, Adhemerval Zanella wrote: > This patch consolidates the Linux access implementation on > sysdeps/unix/sysv/linux/access.c. Similar to auto-generation through > syscalls.list, __NR_access is check and __NR_faccessat is used only > for newer architectures (where __NR_access is not defined). > > Checked on x86_64. OK to checkin if you test this on a second arch, preferably aarch64, and fix the comment below. > * sysdeps/unix/sysv/linux/access.c: New file. > * sysdeps/unix/sysv/linux/generic/access.c: Remove file. > --- > ChangeLog | 5 +++++ > sysdeps/unix/sysv/linux/access.c | 32 ++++++++++++++++++++++++++++++++ > sysdeps/unix/sysv/linux/generic/access.c | 31 ------------------------------- > 3 files changed, 37 insertions(+), 31 deletions(-) > create mode 100644 sysdeps/unix/sysv/linux/access.c > delete mode 100644 sysdeps/unix/sysv/linux/generic/access.c > > diff --git a/sysdeps/unix/sysv/linux/access.c b/sysdeps/unix/sysv/linux/access.c > new file mode 100644 > index 0000000..cdb7908 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/access.c > @@ -0,0 +1,32 @@ As Siddhesh notes this needs first line comment. > +/* Copyright (C) 2016 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + 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 > + . */ > + > +#include > +#include > +#include > + > +/* Test for access to FILE. */ > +int > +__access (const char *file, int type) > +{ > +#ifdef __NR_access > + return INLINE_SYSCALL_CALL (access, file, type); > +#else > + return INLINE_SYSCALL_CALL (faccessat, AT_FDCWD, file, type); > +#endif > +} > +weak_alias (__access, access) > diff --git a/sysdeps/unix/sysv/linux/generic/access.c b/sysdeps/unix/sysv/linux/generic/access.c > deleted file mode 100644 > index 586aa93..0000000 > --- a/sysdeps/unix/sysv/linux/generic/access.c > +++ /dev/null > @@ -1,31 +0,0 @@ > -/* 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 > - . */ > - > -#include > -#include > -#include > -#include > -#include > - > -/* Test for access to FILE. */ > -int > -__access (const char *file, int type) > -{ > - return INLINE_SYSCALL (faccessat, 3, AT_FDCWD, file, type); > -} > -weak_alias (__access, access) -- Cheers, Carlos.