This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/6] New internal function __access_noerrno
- From: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Wed, 9 Nov 2016 00:30:27 +0530
- Subject: Re: [PATCH 2/6] New internal function __access_noerrno
- Authentication-results: sourceware.org; auth=none
- 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>
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