Attempt to support EINTR from select()
parent
7ee2128ff0
commit
56b12ba4c0
|
@ -10,8 +10,6 @@
|
||||||
- mov 0x0(%esi),%ecx why?
|
- mov 0x0(%esi),%ecx why?
|
||||||
- mac intel: perhaps its not a good idea using ebx as allot-tmp-reg
|
- mac intel: perhaps its not a good idea using ebx as allot-tmp-reg
|
||||||
- RNG is broken
|
- RNG is broken
|
||||||
- gdb triggered 'interrupted system call' error
|
|
||||||
- fdasfsdfsa :help -- weird
|
|
||||||
- %allot-bignum-signed-2 still has issues on ppc
|
- %allot-bignum-signed-2 still has issues on ppc
|
||||||
- fix %allot-bignum-signed-1/2 on x86
|
- fix %allot-bignum-signed-1/2 on x86
|
||||||
|
|
||||||
|
|
|
@ -82,9 +82,12 @@ M: port set-timeout
|
||||||
[ "Error on fd " % dup port-handle # ": " % swap % ] "" make
|
[ "Error on fd " % dup port-handle # ": " % swap % ] "" make
|
||||||
swap set-port-error ;
|
swap set-port-error ;
|
||||||
|
|
||||||
|
: ignorable-error? ( n -- ? )
|
||||||
|
dup EAGAIN number= swap EINTR number= or ;
|
||||||
|
|
||||||
: defer-error ( port -- ? )
|
: defer-error ( port -- ? )
|
||||||
#! Return t if it is an unrecoverable error.
|
#! Return t if it is an unrecoverable error.
|
||||||
err_no dup EAGAIN = over EINTR = or
|
err_no dup ignorable-error?
|
||||||
[ 2drop f ] [ strerror swap report-error t ] if ;
|
[ 2drop f ] [ strerror swap report-error t ] if ;
|
||||||
|
|
||||||
! Associates a port with a list of continuations waiting on the
|
! Associates a port with a list of continuations waiting on the
|
||||||
|
@ -145,8 +148,15 @@ GENERIC: task-container ( task -- vector )
|
||||||
read-fdset/tasks init-fdset
|
read-fdset/tasks init-fdset
|
||||||
write-fdset/tasks init-fdset f ;
|
write-fdset/tasks init-fdset f ;
|
||||||
|
|
||||||
|
: (io-multiplex) ( ms -- )
|
||||||
|
[ FD_SETSIZE init-fdsets ] keep make-timeval select 0 < [
|
||||||
|
err_no ignorable-error? [ (io-multiplex) ] [ drop ] if
|
||||||
|
] [
|
||||||
|
drop
|
||||||
|
] if ;
|
||||||
|
|
||||||
: io-multiplex ( ms -- )
|
: io-multiplex ( ms -- )
|
||||||
>r FD_SETSIZE init-fdsets r> make-timeval select io-error
|
(io-multiplex)
|
||||||
read-fdset/tasks handle-fdset
|
read-fdset/tasks handle-fdset
|
||||||
write-fdset/tasks handle-fdset ;
|
write-fdset/tasks handle-fdset ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue