On Thu, Nov 19, 2015 at 10:30 PM, Eric Haszlakiewicz <e...@nimenees.com> wrote:
> On November 19, 2015 4:28:46 AM EST, Paul Goyette <p...@vps1.whooppee.com> 
> wrote:
>>And if there's anyone who really understands HOW the initial syscall
>>gets interrupted when the signal is being delivered (and HOW it gets
>>restarted when the handler returns) I would love an explanation!
>>
>
> Regarding restart, I don't think it needs to be explicitly saved anywhere, 
> because the original call in the userland program has the necessary 
> information.
>
> E.g. if you look at the restart path for alpha (just because that's the first 
> search result I found) you see that it simply moves the userland process' 
> program counter back a bit, and let's the process trigger the syscall again:
> http://nxr.netbsd.org/xref/src/sys/arch/alpha/alpha/syscall.c#203
>
> Dunno about how it's actually interrupted though.

My understanding (as of writing this mail) is that, when syscall()
receives ERESTART, it updates PC in the trapframe; which will be
stored in the signal handler stack by sendsig_siginfo(), and then
later be restored by setcontext(2), when signal handler returns from
signal trampoline.

>
> Eric
>

Reply via email to