1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
17
18#ifndef _SYS_PRCTL_H
19#define _SYS_PRCTL_H 1
20
21#include <features.h>
22#include <linux/prctl.h> /* The magic values come from here */
23
24/* Recent extensions to linux which may post-date the kernel headers
25 we're picking up... */
26
27/* Memory tagging control operations (for AArch64). */
28#ifndef PR_TAGGED_ADDR_ENABLE
29# define PR_TAGGED_ADDR_ENABLE (1UL << 8)
30#endif
31
32#ifndef PR_MTE_TCF_SHIFT
33# define PR_MTE_TCF_SHIFT 1
34# define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
35# define PR_MTE_TCF_SYNC (1UL << PR_MTE_TCF_SHIFT)
36# define PR_MTE_TCF_ASYNC (2UL << PR_MTE_TCF_SHIFT)
37# define PR_MTE_TCF_MASK (3UL << PR_MTE_TCF_SHIFT)
38# define PR_MTE_TAG_SHIFT 3
39# define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)
40#endif
41
42__BEGIN_DECLS
43
44/* Control process execution. */
45extern int prctl (int __option, ...) __THROW;
46
47__END_DECLS
48
49#endif /* sys/prctl.h */
50