[PATCH] mips: Fix store/load gp registers to/from ucontext_t

Joseph Myers joseph@codesourcery.com
Thu May 18 19:53:00 GMT 2017


On Thu, 18 May 2017, Maciej W. Rozycki wrote:

>  Not according to SUSv2 [1] AFAICT:
> 
> "The setcontext() function restores the user context pointed to by ucp.  
> A successful call to setcontext() does not return; program execution 
> resumes at the point specified by the ucp argument passed to setcontext().  
> The ucp argument should be created either by a prior call to getcontext() 
> or makecontext(), or by being passed as an argument to a signal handler."
> 
> -- notice the last statement.

Note that it says what the semantics are "If the ucp argument was created 
with getcontext()" and "If the ucp argument was created with 
makecontext()".  It does *not* say what the semantics are if it came from 
a signal handler; they are unspecified.  That is, SUSv2 deliberately 
removed the (presumably problematic) specification from XPG4.2 about the 
results "If the ucp argument was passed to a signal handler".

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list