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

Joseph Myers joseph@codesourcery.com
Tue Oct 22 22:39:00 GMT 2019


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.

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 
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.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list