Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJgzZoqh=Mm1Hnuabnig_7fWXTSb7DYj_LBeS0xZWO8vVwfong@mail.gmail.com>
Date: Thu, 12 Jun 2025 12:28:24 -0400
From: enh <enh@...gle.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com, Namhyung Kim <namhyung@...nel.org>, 
	Arnaldo Carvalho de Melo <acme@...nel.org>, Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: sys/prctl.h differences vs man page

https://man7.org/linux/man-pages/man2/prctl.2.html

On Thu, Jun 12, 2025 at 12:26 PM Rich Felker <dalias@...c.org> wrote:
>
> On Thu, Jun 12, 2025 at 10:31:03AM -0400, enh wrote:
> > yeah, apologies that i don't think i reported this to the list before,
> > but android also hit various prctl portability issues trying to use
> > musl as the host libc and added this ahead of the musl <sys/prctl.h>
> > as our workaround:
> >
> > #ifndef _SYS_PRCTL_H
> > #define _SYS_PRCTL_H
> >
> > #ifdef __cplusplus
> > extern "C" {
> > #endif
> >
> > #include <stdint.h>
> >
> > /*
> >  * Get the constants and structs from uapi so that code that
> >  * includes <linux/prctl.h> doesn't conflict with <sys/prctl.h>.
> >  */
> > #include <linux/prctl.h>
> >
> > int prctl (int, ...);
> >
> > #ifdef __cplusplus
> > }
> > #endif
> >
> > #endif
> >
> > "we don't duplicate anything that's in a uapi header" is just what
> > bionic does for everything, all the time, but interestingly
> > <sys/prctl.h> is a rare header where glibc also doesn't do their usual
> > copy & paste and just includes <linux/prctl.h> instead. (which is why
> > this is an issue unique to musl, not one shared with glibc.)
>
> musl policy is generally the opposite; we don't include any linux uapi
> headers and don't expect them to be namespace-safe to include from
> userspace headers. Many historically haven't been, and aside from
> namespace violations, they made conflicting definitions with userspace
> types.
>
> glibc is more in the middle on this, usually not including linux uapi
> headers, but sometimes doing it.
>
> I don't see where it's documented that one should include
> <linux/prctl.h> to use the prctl API. It's not in my copy of the man
> page.
>
> Rich

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.