[PATCH 2/6] New internal function __access_noerrno
Siddhesh Poyarekar
siddhesh@gotplt.org
Tue Nov 8 19:00:00 GMT 2016
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
More information about the Libc-alpha
mailing list