|
|
Message-ID: <20250612064940.ukl7RfT2@linutronix.de>
Date: Thu, 12 Jun 2025 08:49:40 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: musl@...ts.openwall.com
Cc: Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: sys/prctl.h differences vs man page
Hi,
the man page for prctl(2) states:
| SYNOPSIS
| #include <linux/prctl.h> /* Definition of PR_* constants */
| #include <sys/prctl.h>
if one is going to include both headers then this happens:
| In file included from file.c:6:
| /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
| 88 | struct prctl_mm_map {
| | ^~~~~~~~~~~~
| In file included from file.c:5:
| /linux/tools/include/uapi/linux/prctl.h:134:8: note: originally defined here
| 134 | struct prctl_mm_map {
| | ^~~~~~~~~~~~
The problem is that musl's provided sys/prctl.h defines the struct
prctl_mm_map which is a copy of linux kernel's linux/prctl.h. This breaks
compiles based on the man page because that struct is defined twice.
It makes it harder to write software which replaces linux/prctl.h with
current header file while testing for recent features. It also increases
the maintenance on musl's side to keep that file up to date.
Could you please ship sys/prctl.h which provides the prctl() definition
and include the PR_* definition from linux/prctl.h?
This problem has been observed on Alpine Linux by Namhyung Kim [0].
[0] https://lore.kernel.org/all/aEh6xO14wDSCFUDr@google.com/T/#u
Sebastian
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.