[PATCH] linux/mips: handle wait status 0x7f specially for WIFSIGNALED and WIFSTOPPED

Xi Ruoyao xry111@xry111.site
Thu Feb 12 15:20:58 GMT 2026


On Thu, 2026-02-12 at 15:42 +0100, Florian Weimer wrote:
> * Xi Ruoyao:
> 
> > On Thu, 2026-02-12 at 14:43 +0100, Florian Weimer wrote:
> > > * Xi Ruoyao:
> > > 
> > > > MIPS Linux has SIGRTMAX=127, thus the wait status 0x7f means the program
> > > > is terminated by SIGRTMAX, not stopped.
> > > > 
> > > > This cannot happen on other ports so make a special version of
> > > > waitstatus.h for MIPS to avoid adding redundant calculation to others.
> > > > I cannot find a way to use status only once in the expression, so use
> > > > inline functions instead of macros to avoid double-evaluating status.
> > > 
> > > What happens with exit (127) before and after these changes?
> > 
> > exit (127) produces wstatus=0x7f00, not 0x007f.  Thus with or without
> > the changes it's handled correctly.
> 
> Ahh.  Is there still an ambiguity when the process is running under
> ptrace, and SIGRTMAX causes a stop?

That would be wstatus=0x7f7f then (the high byte is the stop signal, the
low byte is 0x7f).  Thus if "signal 0" can stop the process we'd get an
ambiguity.  But AFAIK there's no such a "signal 0" or am I wrong?

-- 
Xi Ruoyao <xry111@xry111.site>


More information about the Libc-alpha mailing list