blob: d7c43aa2558951ba1c5c3d18c6a638e2bb7fe5a7 [file] [log] [blame]
Alistair Delva3b58ccb2020-08-24 13:54:16 -07001/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6#include <asm/unistd.h>
7
8/* Ideally minijail is compiled against a modern libc, which has modern copies
9 * of Linux uapi for ioctls, and unistd.h for syscalls. However, sometimes this
10 * isn't possible - such as when building with the Android host toolchain - so
11 * locally define the system calls in use in active seccomp policy files.
12 * This UAPI is taken from sanitized bionic headers.
13 */
14
15#ifndef __NR_copy_file_range
16#ifdef __x86_64__
17#define __NR_copy_file_range 326
18#elif __i386__
19#define __NR_copy_file_range 377
20#elif __arm64__
21#define __NR_copy_file_range 285
22#endif
23#endif /* __NR_copy_file_range */
24
25#ifndef __NR_getrandom
26#ifdef __x86_64__
27#define __NR_getrandom 318
28#elif __i386__
29#define __NR_getrandom 355
30#elif __arm64__
31#define __NR_getrandom 278
32#endif
33#endif /* __NR_getrandom */
34
35#ifndef __NR_memfd_create
36#ifdef __x86_64__
37#define __NR_memfd_create 319
38#elif __i386__
39#define __NR_memfd_create 356
40#elif __arm64__
41#define __NR_memfd_create 279
42#endif
43#endif /* __NR_memfd_create */
44
45#ifndef __NR_renameat2
46#ifdef __x86_64__
47#define __NR_renameat2 316
48#elif __i386__
49#define __NR_renameat2 353
50#elif __arm64__
51#define __NR_renameat2 276
52#endif
53#endif /* __NR_renameat2 */
54
55#ifndef __NR_statx
56#ifdef __x86_64__
57#define __NR_statx 332
58#elif __i386__
59#define __NR_statx 383
60#elif __arm64__
61#define __NR_statx 291
62#endif
63#endif /* __NR_statx */
Alistair Delvab5546ad2021-03-11 08:04:44 -080064
65#ifndef __NR_io_uring_enter
66#define __NR_io_uring_enter 426
67#endif
68
69#ifndef __NR_io_uring_register
70#define __NR_io_uring_register 427
71#endif
72
73#ifndef __NR_io_uring_setup
74#define __NR_io_uring_setup 425
75#endif
Alistair Delva59b0ebe2021-11-10 12:16:53 -080076
77#ifndef __NR_faccessat2
78#define __NR_faccessat2 439
79#endif