I thought restarting the syscalls wasn't explicit when I read the draft.  If restarting semantics is clear, I'm all for it.

Regarding preventing restarts:

 Note that if you want otherwise, that is, you don't
want to restart the syscall, you can just throw your own exception from the signal handler.

But if the exception handler has not been entered on EINTR (which I think is correct), there is no recovery.

I have the feeling that I am not understanding you correctly.


What I meant is something like this:

(set-signal-handler signal/int (lambda (sig) (raise 'interrupted)))

(guard (e ((eq? e 'interrupted) e))
   ... (select-ports ...) ...)

If SIGINT interrupts select-ports, the handler raises an exception and select() syscall won't be restarted.



 
 
There are a few POSIX syscalls that doesn't go well with this delayed-signal-handling
and automatic restarting, though they're not included in srfi-170.  
I list them for the future reference.

There are other cases as well: if read() is interrupted after some bytes have been read,
you need to increment the buffer pointer and decrement the length.


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
        Raffiniert ist der Herrgott, aber boshaft ist er nicht.
                --Albert Einstein