Hi Andras,

> According to the man page on macOS, poll returns:
> 
>      [EINVAL]           The nfds argument is greater than OPEN_MAX or the
>                         timeout argument is less than -1.

That explains it! So the specification of poll() is indeed different from the
Linux one.


> The check at compile time is not triggered on macOS, the following program
> prints “false”:
> 
> #include <stdlib.h>
> #include <stdio.h>
> 
> int main(int argc, char*argv[])
> {
> #if (int)-1 == 0xFFFFFFFF
> printf("true");
> #else
> printf("false");
> #endif
>   return 0;

Hmm, too bad! I tested here with 64-bit integers with

   #if (int)-1 == 0xFFFFFFFFFFFFFFFF

and it worked.


Unfortunately, "#if sizeof(int) == 4" is not allowed in C, that's why I used the
above construct.

Does anybody have a better idea?

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to