Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK4o1WyPqDQqOs+zYkYjHFN1hRjt7bFqUCW4__dNKPS78EvP4w@mail.gmail.com>
Date: Tue, 24 Jun 2014 11:05:01 +0100
From: Justin Cormack <justin@...cialbusservice.com>
To: musl@...ts.openwall.com
Subject: Re: getcontext etc was Re: Re: go support (was: Best
 place to discuss other lightweight libraries?)

On Jun 23, 2014 11:32 PM, "Rich Felker" <dalias@...c.org> wrote:
> > Just to revive this post 1.0, it would be very nice indeed to have
> > set,get,swapcontext.
>
> One approach to setcontext would be using rt_sigreturn, but I've heard
> there are issues using it for setcontext involving the alternate
> signal stack. It's the only way to do resuming _async_ (i.e. the
> ucontext received by a signal handler for the state it interrupted)
> contexts though, so maybe there's some way to make it work. This issue
> was discussed recently on libc-alpha (the glibc list).

I am not interested in the async case not sure if other users are. If I
read the glibc discussion correctly they are not supporting this any more?

> Otherwise, if async contexts don't need to be supported, these
> functions are essentially just mechanical transformations of
> sigsetjmp/siglongjmp. I think setcontext could be implemented just as
> a transformation of the mcontext_t register values into a jmp_buf,
> followed by a call to siglongjmp. For getcontext, you can't just wrap
> sigsetjmp since wrapping returns-twice functions is impossible. But
> maybe there's some way to make it work without code duplication.
>

This sounds promising. Will take a look at the code.

Justin

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.