diff mbox series

AW: [RFC v3 04/17] arch_prctl.2: SYNOPSIS: Remove unused includes

Message ID be6a5420c2de4cd5a772a878a173fd09@bfs.de
State New
Headers show
Series AW: [RFC v3 04/17] arch_prctl.2: SYNOPSIS: Remove unused includes | expand

Commit Message

Walter Harms March 15, 2021, 6 p.m. UTC
I have learned the other way around:
#include <sys/prctl.h>
Is a general system header to use that may include
the asm/prctrl.h what should never be included by
userspace programms.

jm2c,
re,
 wh

Comments

Alejandro Colomar \(man-pages\) March 16, 2021, 4:50 p.m. UTC | #1
Hi Walter,

On 3/15/21 7:00 PM, Walter Harms wrote:
> I have learned the other way around:
> #include <sys/prctl.h>
> Is a general system header to use that may include
> the asm/prctrl.h what should never be included by
> userspace programms.
> 

Are you sure that <sys/prctl.h> includes <asm/prctl.h>?

user@debian:/usr/include$ grep -rn '\bARCH_'
asm-generic/statfs.h:42:#ifndef ARCH_PACK_STATFS64
asm-generic/statfs.h:43:#define ARCH_PACK_STATFS64
asm-generic/statfs.h:59:} ARCH_PACK_STATFS64;
asm-generic/statfs.h:65:#ifndef ARCH_PACK_COMPAT_STATFS64
asm-generic/statfs.h:66:#define ARCH_PACK_COMPAT_STATFS64
asm-generic/statfs.h:82:} ARCH_PACK_COMPAT_STATFS64;
x86_64-linux-gnu/asm/statfs.h:10:#define ARCH_PACK_COMPAT_STATFS64 
__attribute__((packed,aligned(4)))
x86_64-linux-gnu/asm/prctl.h:5:#define ARCH_SET_GS		0x1001
x86_64-linux-gnu/asm/prctl.h:6:#define ARCH_SET_FS		0x1002
x86_64-linux-gnu/asm/prctl.h:7:#define ARCH_GET_FS		0x1003
x86_64-linux-gnu/asm/prctl.h:8:#define ARCH_GET_GS		0x1004
x86_64-linux-gnu/asm/prctl.h:10:#define ARCH_GET_CPUID		0x1011
x86_64-linux-gnu/asm/prctl.h:11:#define ARCH_SET_CPUID		0x1012
x86_64-linux-gnu/asm/prctl.h:13:#define ARCH_MAP_VDSO_X32	0x2001
x86_64-linux-gnu/asm/prctl.h:14:#define ARCH_MAP_VDSO_32	0x2002
x86_64-linux-gnu/asm/prctl.h:15:#define ARCH_MAP_VDSO_64	0x2003
x86_64-linux-gnu/asm/auxvec.h:13:/* entries in ARCH_DLINFO: */
user@debian:/usr/include$ grep -rn 'asm/prctl.h'
user@debian:/usr/include$

At least on my system, no header seems to be including <asm/prctl.h>.

Thanks,

Alex
diff mbox series

Patch

diff --git a/man2/arch_prctl.2 b/man2/arch_prctl.2
index 8706cd1ec..d1b9e16f9 100644
--- a/man2/arch_prctl.2
+++ b/man2/arch_prctl.2
@@ -28,7 +28,6 @@  arch_prctl \- set architecture-specific thread state
 .SH SYNOPSIS
 .nf
 .BR "#include <asm/prctl.h>" "        /* Definition of " ARCH_* " constants */"
-.B #include <sys/prctl.h>
 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
 .B #include <unistd.h>
 .PP