Email list hosting service & mailing list manager

Signal handling and system calls Shiro Kawai (11 May 2019 07:31 UTC)
Re: Signal handling and system calls John Cowan (11 May 2019 22:04 UTC)
Re: Signal handling and system calls Lassi Kortela (12 May 2019 08:46 UTC)
Re: Signal handling and system calls Lassi Kortela (12 May 2019 09:03 UTC)
Re: Signal handling and system calls Shiro Kawai (12 May 2019 11:04 UTC)
Re: Signal handling and system calls John Cowan (12 May 2019 16:38 UTC)
Re: Signal handling and system calls Shiro Kawai (12 May 2019 18:02 UTC)
Re: Signal handling and system calls Shiro Kawai (12 May 2019 10:57 UTC)

Re: Signal handling and system calls Lassi Kortela 12 May 2019 08:46 UTC

>     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.

If you throw an exception from the signal handler, which thread is that
exception raised in? If we always run a Scheme signal handler in the
main thread, or let Unix pick a thread at random, in either case it can
be a different thread than the one that was running when we got the signal.

> 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.

Don't read() and similar syscalls just return -1 bytes read and set
errno to EINTR? I wasn't aware that they'd return partial data when
interrupted by a signal.