[PATCH 1/2] misc: Set generic pselect as ENOSYS

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Nov 15 14:39:00 GMT 2019



On 14/11/2019 19:20, Lukasz Majewski wrote:
> Dear Adhemerval,
> 
>> +__pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set
>> *exceptfds,
>> +	   const struct timespec *timeout, const sigset_t *sigmask)
>> +{
>> +  int ret = __pselect_syscall (nfds, readfds, writefds, exceptfds,
>> timeout,
>> +			       sigmask);
>> +  if (ret < 0 && errno != ENOSYS)
>> +    return ret;
> 
> Is the above condition correct?
> 
> The pselect returns -1 on error or >= 0 on success.
> 
> Shouldn't it be instead:
> 
> if (! (ret == -1 && errno == ENOSYS))
> 
> Only when pselect is not supported we shall fallback to select based
> implementation.

Indeed, we need to take care of ret being 0.  Fixed locally.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20191115/f303bf53/attachment.sig>


More information about the Libc-alpha mailing list