prctl: Support movement of arch prctls out of common code
A message that is not in the archive (sent off-list or not yet received): 5252accbd67022cea25e5aa80e48d95c.localhost
Quoted 40 lines · Will Deacon
Hi Dave,
Quoted 20 lines · Dave Martin
The core framework for the
prctl()syscall is unloved and looking rather crusty these days. It also relies on defining ancillary boilerplate macros for eachprctl()in order to control conditional compilation of the different prctl calls. We have better ways to do this now, usingKconfig.This patch defines a new arch hook
arch_syscall(). Architectures that implemement arch-specific syscalls can now selectHAVE_ARCH_SYSCALLin theirKconfigand define this function appropriately.The core
prctl()implementation now matches option against the list of common or legacy prctls, deferring toprctl_arch()if an unrecognised option is encountered.(
arch_prctl()would have been a nicer name, but it conflicts with the pre-existing syscall of the same name on x86, particularly in the um code.)No functional change.
[...]
include/uapi/linux/prctl.h line 3
Quoted 10 lines
include/uapi/linux/prctl.h +2
-2@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _LINUX_PRCTL_H -#define _LINUX_PRCTL_H +#ifndef _UAPI_LINUX_PRCTL_H +#define _UAPI_LINUX_PRCTL_HIs it safe to rename this #define, or is there a possibility that userspace could be using it for something and relying on it not changing?
Quoted 3 lines
Other than that:
Acked-by Will Deacon <[email protected]>
I think that header guards are generally viewed as being private to a project and not API. codesearch.debian.net yields few hits, where there are actual #ifdefs on this symbol, they seem to be pastes of the kernel headers:
https://codesearch.debian.net/search?q=_LINUX_PRCTL_H&perpkg=1
-> android, linux, dietlibc ... gnome-chess (?)
There is plenty of precedent in the Howells special:
607ca46e97a1 ("UAPI: (Scripted) Disintegrate include/linux")
See for example <{,uapi/}linux/loop.h>.
Cheers
---Dave