Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 4 Feb 2016 10:41:38 -0500
From: Rich Felker <>
Subject: Re: setcontext/getcontext/makecontext missing?

On Thu, Feb 04, 2016 at 03:54:09PM +0100, Szabolcs Nagy wrote:
> * Short, Todd <> [2016-02-04 14:09:30 +0000]:
> > 
> > It appears that setcontext/getcontext/makecontext are declared in
> > ./include/ucontext.h, but there???s no definitions for them in
> > musl. These three functions are part of libc/
> > 
> these are deprecated posix apis.
> > Since the functions are declared, is there any intent to put them into musl?
> > 
> they have unclear semantics and only possible to
> implement in asm (hence it is a significant effort
> to add them).

There's been some interest in adding them and they were on a long-term
goal list, but I'm not sure it makes sense anymore. All the major
users of this API have been moving _off_ of it, because it's
deprecated and impossible to use correctly - see the rationale here:

So it's rather unfortunate (but typical OpenSSL nonsense) that they've
adding a new use of it.

> > I ran into this when attempting to compile OpenSSL with musl. In
> > the OpenSSL master branch, I???m able to do:
> > 
> > CC=musl-gcc ./config
> > make depend
> > make
> > 
> > However, ld fails because there is an undefined reference to
> > setcontext, getcontext and makecontext. This is new async
> > functionality in OpenSSL that uses these APIS.
> > 
> imho that's an openssl bug.
> if they really need the *context apis, then use adequate
> (link-time) configure check for them.

Agree strongly. There's at least one other major POSIX/POSIX-like
system that lacks them.

> but looking at
> this async lib is probably misguided, but they can
> implement the api with pthreads in a portable way.



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.