This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

setcontext in a signal handler


Hi Michael,

The current getcontext(3) manpage has the following wording:

"Do  not  leave  the  handler  using longjmp(3): it is undefined what
would happen with contexts.  Use siglongjmp(3) or setcontext()
instead."

However the glibc documentation[1] has this:

" It is not allowed to do the context switching from the signal
handler directly since neither setcontext nor swapcontext are
functions which can be called from a signal handler."

It's not clear to me that there is any standard that mandates that
setcontext cannot be called from a signal handler or whether it is an
implementation detail of glibc. Does anybody know of any historical
reasons for this being the case?

Thanks,

[1] http://www.gnu.org/software/libc/manual/html_node/System-V-contexts.html

-- 
Will Newton
Toolchain Working Group, Linaro


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]