sys/param.h: Add _WANT_P_OSREL

Use it instead of defining IN_RTLD by base sources that want P_OSREL_
defines in userspace, but are not rtld.
This allows to remove abuse of IN_RTLD from userspace.

Reviewed by:	dchagin, markj, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38585
This commit is contained in:
Konstantin Belousov 2023-02-14 10:52:14 +02:00
parent 4b0552d5f4
commit 5942b4b6fd
9 changed files with 9 additions and 11 deletions

View file

@ -33,9 +33,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define IN_RTLD 1
#define _WANT_P_OSREL
#include <sys/param.h>
#undef IN_RTLD
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>

View file

@ -33,9 +33,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define IN_RTLD 1
#define _WANT_P_OSREL
#include <sys/param.h>
#undef IN_RTLD
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>

View file

@ -33,9 +33,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define IN_RTLD 1
#define _WANT_P_OSREL
#include <sys/param.h>
#undef IN_RTLD
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>

View file

@ -33,9 +33,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define IN_RTLD 1
#define _WANT_P_OSREL
#include <sys/param.h>
#undef IN_RTLD
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>

View file

@ -33,6 +33,7 @@
* John Polstra <jdp@polstra.com>.
*/
#define _WANT_P_OSREL
#include <sys/param.h>
#include <sys/mman.h>
#include <machine/cpufunc.h>

View file

@ -27,6 +27,7 @@
* $FreeBSD$
*/
#define _WANT_P_OSREL
#include <sys/param.h>
#include <sys/mman.h>
#include <sys/stat.h>

View file

@ -43,7 +43,7 @@ static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define IN_RTLD /* So we pickup the P_OSREL defines */
#define _WANT_P_OSREL
#include <sys/param.h>
#include <sys/file.h>
#include <sys/mount.h>

View file

@ -46,7 +46,7 @@ static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define IN_RTLD /* So we pickup the P_OSREL defines */
#define _WANT_P_OSREL
#include <sys/param.h>
#include <sys/disklabel.h>
#include <sys/file.h>

View file

@ -94,7 +94,7 @@
#undef __FreeBSD_kernel__
#define __FreeBSD_kernel__
#if defined(_KERNEL) || defined(IN_RTLD)
#if defined(_KERNEL) || defined(_WANT_P_OSREL)
#define P_OSREL_SIGWAIT 700000
#define P_OSREL_SIGSEGV 700004
#define P_OSREL_MAP_ANON 800104