[PATCH 1/2] misc: Set generic pselect as ENOSYS
Joseph Myers
joseph@codesourcery.com
Thu Nov 14 20:50:00 GMT 2019
On Thu, 14 Nov 2019, Adhemerval Zanella wrote:
> The generic pselect implementation has the very specific race condition
> that motived the creation of the pselect syscall (no atomicity in
> signal mask set/reset). Using it as generic implementation is
> counterproductive Also currently only microblaze uses it as fallback
> when used on kernel prior 3.15.
>
> This patch moves the generic implementation to a microblaze specific
> one, sets the generic internal as a ENOSYS, and cleanups the Linux
> generic implementation.
>
> Also, the microblaze generic implementation first try to issue
> pselect instead of use the fallback (since it is expect that if
> the microblaze usage does rely on pselect, a sufficient updated
> kernel will be used). Microblaze defines __NR_pselect6 for Linux
> v3.2, although it was only wire-up on v3.15 (and the syscall number
> is the same as previous defined).
I'll raise the same issue here I raise whenever someone proposes having
fallback code for old kernels without a corresponding __ASSUME_* macro.
We need a simple and uniform way, when increasing the minimum kernel
version, to find all the fallback code that can be removed. That means
__ASSUME_* macros in kernel-features.h based on __LINUX_KERNEL_VERSION.
A free-form text comment mentioning "3.15" is no good for that purpose as
there is no sensible automated way to find all such comments when
increasing the minimum from 3.2 to 4.4 (for example, as the next such
increase that seems to make sense in terms of the cleanups it enables).
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list