This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] sysdeps/wait: Use the waitid syscall if required


On Tue, Oct 22, 2019 at 3:39 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Tue, 22 Oct 2019, Alistair Francis wrote:
>
> > How would I do this? The only option I can see is for RISC-V to have
> > it's own syscall.list that removes the wait4 call. Is there a better
> > way to override these?
>
> You could write a wait4.c implementation which overrides the syscalls.list
> entry by being in a sysdeps directory that gets searched earlier (and
> check the build logs to make sure the intended implementation is indeed
> getting built, as it's easy to get sysdeps ordering wrong).  You don't
> need your own syscalls.list.

Ah, that's very helpful.

>
> If this issue applies for all future 32-bit linux/generic architectures,
> the implementation might go in sysdeps/unix/sysv/linux/generic/wordsize-32
> and have #if conditionals allowing it use the wait4 syscall on
> architectures that have it, if doing so is desirable.  It shouldn't go in

Yes, it isn't RISC-V specific, so that makes sense.

> a RISC-V-specific directory unless it's genuinely specific to RISC-V and
> not other future architectures.  Or it could go in
> sysdeps/unix/sysv/linux/wait4.c, with the syscalls.list entry being
> removed.

This seems like the best option to me, as every 32-bit architectures
is one day going to need this and maybe others will as well.

Would adding sysdeps/unix/sysv/linux/wait4.c and removing wait from
syscalls.list be ok with everyone?
Otherwise I'll put it in sysdeps/unix/sysv/linux/generic/wordsize-32/wait4.c.

For the implementation it looks like I can just copy __libc_wait() but
use INLINE_SYSCALL_CALL()'s instead.

Alistair

>
> --
> Joseph S. Myers
> joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]