[PATCH] display mask on enter to sigreturn, not exit

Denys Vlasenko dvlasenk at redhat.com
Wed Jan 11 00:12:39 UTC 2012


On 01/10/2012 09:19 PM, Dmitry V. Levin wrote:
>> While at it, I made it so that we do display returned value/errno.
>> I see no point in hiding it and showing uninformative "= ?" instead.
>
> Is there any actual difference?  Is there any case when sigreturn() may
> "return" something different from EINTR?

Yes. -EINTR return means that the interrupted system call won't be restarted.
It looks like this:

rt_sigsuspend([ABRT])                   = ? ERESTARTNOHAND (To be restarted)
--- {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=134513920, ptr=0x8048500}} (Alarm clock) ---
alarm(1)                                = 0
sigreturn() (mask now [ABRT])           = -1 EINTR (Interrupted system call)

Whereas the case when syscall is restarted looks like this:

read(0, 0x8121750, 1024)                = ? ERESTARTSYS (To be restarted)
--- {si_signo=SIGALRM, si_code=SI_KERNEL, si_value={int=134513920, ptr=0x8048500}} (Alarm clock) ---
alarm(1)                                = 0
sigreturn() (mask now [ABRT])           = 3
read(0, 0x8121750, 1024)...

This is a potentially useful bit of information we weren't showing.

-- 
vda




More information about the Strace-devel mailing list