Hi all,

I just stumbled across this mail in the archive. I have not received it, and the
sending e-mail address seems just "picolisp".

> picolisp Sun, 11 Apr 2021 15:05:25 -0700
>
> I am trying to fix infinite select errors about 292MY.
>
> On my mac (int)9223372036854775807 == -1 which means no timeout.

This is strange! The number 292MY is the biggest *positive* 64-bit number. A
call to waitFd() is compiled to e.g.:

   call i64 @waitFd(i64 %0, i32 -1, i64 9223372036854775807)

Does this mean the Mac uses only the lowest 32 bits?


Also, -1 does *not* mean "no timeout". It means infinite timeout.


> Why not simply use -1?

This would not work, because waitFd() compares the value to all other timeouts
in the task list. So it needs a big positive number.


> When Ms decrement to 9223372036854775806, (int)timeout becomes -2 which is 
> less
> than -1, then poll() returns EINVAL.

This is equally strange! The man page of poll() says "Specifying a negative
value in timeout means an infinite timeout". -2 or any other negative number
does no harm.


> src/lib.c: warning: '&' within '|' [-Wbitwise-op-parentheses]

I hate compilers treating me like a child! ;)


In summary, the problem seems to be that 'int's on the Mac are only 32 bit. But
that would break many other things, no? Any other Mac users here? I thought
pil21 runs on the Mac (?).

☺/ A!ex

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

Reply via email to