From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13251 invoked by alias); 8 Nov 2016 19:00:44 -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 13163 invoked by uid 89); 8 Nov 2016 19:00:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: homiemail-a80.g.dreamhost.com Subject: Re: [PATCH 2/6] New internal function __access_noerrno To: Adhemerval Zanella , libc-alpha@sourceware.org References: <1477320168-23397-1-git-send-email-siddhesh@sourceware.org> <1477320168-23397-3-git-send-email-siddhesh@sourceware.org> <317e63c8-1681-84b1-e278-c6ecae71e657@linaro.org> From: Siddhesh Poyarekar Message-ID: <4f13d235-084b-25f8-b763-053889b0dfdb@gotplt.org> Date: Tue, 08 Nov 2016 19:00: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: <317e63c8-1681-84b1-e278-c6ecae71e657@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00280.txt.bz2 On Tuesday 08 November 2016 10:39 PM, Adhemerval Zanella wrote: > Is this comment correct? Checking the patch I am seeing it builds > only for libc and there is no resulting __access_noerrno on ld.so. It builds for both. rtld-Rules has a rule that looks at all of the libc functions that rtld uses and rebuilds all of them inside ld.so. $ nm elf/ld.so | grep access_noerrno 00000000000199d0 t __access_noerrno > I think it would be simpler to just 1. consolidation Linux access > implementation and 2. add the '_noerrno' on same file. > > The 1. would be simpler to just: > > 1.1. Remove access from sysdeps/unix/syscalls.list > 1.2. Move sysdeps/unix/sysv/linux/generic/access.c to > sysdeps/unix/sysv/linux/access.c > 1.3. And implement access checking for __NR_access and > using __NR_facessat if is not defined. Something > like: > > [...] > /* Test for access to FILE. */ > int > __access (const char *file, int type) > { > #if __NR_access > return INLINE_SYSCALL_CALL (access, file, type); > #else > return INLINE_SYSCALL_CALL (faccessat, AT_FDCWD, file, type); > #endif > } > [...] > > Then __access_noerro could be just implemented on same file. > I think it has the advantage of not splitting the access > on multiple files. > > I think for hurd and nacl it would also result in simplify > code. What do you think? The nacl code can be hacked in there somehow I guess, but the hurd code seems quite different and I am a bit reluctant to hack at it without access to a hurd instance to test on. I can hack at sysdeps/unix/sysv/linux/access.c and drop sysdeps/unix/access_noerrno.c. Siddhesh