1*4b9c6d91SCole Faust /* Copyright 2014 The ChromiumOS Authors 2*4b9c6d91SCole Faust * Use of this source code is governed by a BSD-style license that can be 3*4b9c6d91SCole Faust * found in the LICENSE file. 4*4b9c6d91SCole Faust */ 5*4b9c6d91SCole Faust 6*4b9c6d91SCole Faust #include <asm/unistd.h> 7*4b9c6d91SCole Faust 8*4b9c6d91SCole Faust /* Ideally minijail is compiled against a modern libc, which has modern copies 9*4b9c6d91SCole Faust * of Linux uapi for ioctls, and unistd.h for syscalls. However, sometimes this 10*4b9c6d91SCole Faust * isn't possible - such as when building with the Android host toolchain - so 11*4b9c6d91SCole Faust * locally define the system calls in use in active seccomp policy files. 12*4b9c6d91SCole Faust * This UAPI is taken from sanitized bionic headers. 13*4b9c6d91SCole Faust */ 14*4b9c6d91SCole Faust 15*4b9c6d91SCole Faust #ifndef __NR_copy_file_range 16*4b9c6d91SCole Faust #ifdef __x86_64__ 17*4b9c6d91SCole Faust #define __NR_copy_file_range 326 18*4b9c6d91SCole Faust #elif __i386__ 19*4b9c6d91SCole Faust #define __NR_copy_file_range 377 20*4b9c6d91SCole Faust #elif __arm64__ 21*4b9c6d91SCole Faust #define __NR_copy_file_range 285 22*4b9c6d91SCole Faust #endif 23*4b9c6d91SCole Faust #endif /* __NR_copy_file_range */ 24*4b9c6d91SCole Faust 25*4b9c6d91SCole Faust #ifndef __NR_getrandom 26*4b9c6d91SCole Faust #ifdef __x86_64__ 27*4b9c6d91SCole Faust #define __NR_getrandom 318 28*4b9c6d91SCole Faust #elif __i386__ 29*4b9c6d91SCole Faust #define __NR_getrandom 355 30*4b9c6d91SCole Faust #elif __arm64__ 31*4b9c6d91SCole Faust #define __NR_getrandom 278 32*4b9c6d91SCole Faust #endif 33*4b9c6d91SCole Faust #endif /* __NR_getrandom */ 34*4b9c6d91SCole Faust 35*4b9c6d91SCole Faust #ifndef __NR_memfd_create 36*4b9c6d91SCole Faust #ifdef __x86_64__ 37*4b9c6d91SCole Faust #define __NR_memfd_create 319 38*4b9c6d91SCole Faust #elif __i386__ 39*4b9c6d91SCole Faust #define __NR_memfd_create 356 40*4b9c6d91SCole Faust #elif __arm64__ 41*4b9c6d91SCole Faust #define __NR_memfd_create 279 42*4b9c6d91SCole Faust #endif 43*4b9c6d91SCole Faust #endif /* __NR_memfd_create */ 44*4b9c6d91SCole Faust 45*4b9c6d91SCole Faust #ifndef __NR_renameat2 46*4b9c6d91SCole Faust #ifdef __x86_64__ 47*4b9c6d91SCole Faust #define __NR_renameat2 316 48*4b9c6d91SCole Faust #elif __i386__ 49*4b9c6d91SCole Faust #define __NR_renameat2 353 50*4b9c6d91SCole Faust #elif __arm64__ 51*4b9c6d91SCole Faust #define __NR_renameat2 276 52*4b9c6d91SCole Faust #endif 53*4b9c6d91SCole Faust #endif /* __NR_renameat2 */ 54*4b9c6d91SCole Faust 55*4b9c6d91SCole Faust #ifndef __NR_statx 56*4b9c6d91SCole Faust #ifdef __x86_64__ 57*4b9c6d91SCole Faust #define __NR_statx 332 58*4b9c6d91SCole Faust #elif __i386__ 59*4b9c6d91SCole Faust #define __NR_statx 383 60*4b9c6d91SCole Faust #elif __arm64__ 61*4b9c6d91SCole Faust #define __NR_statx 291 62*4b9c6d91SCole Faust #endif 63*4b9c6d91SCole Faust #endif /* __NR_statx */ 64*4b9c6d91SCole Faust 65*4b9c6d91SCole Faust #ifndef __NR_io_uring_enter 66*4b9c6d91SCole Faust #define __NR_io_uring_enter 426 67*4b9c6d91SCole Faust #endif 68*4b9c6d91SCole Faust 69*4b9c6d91SCole Faust #ifndef __NR_io_uring_register 70*4b9c6d91SCole Faust #define __NR_io_uring_register 427 71*4b9c6d91SCole Faust #endif 72*4b9c6d91SCole Faust 73*4b9c6d91SCole Faust #ifndef __NR_io_uring_setup 74*4b9c6d91SCole Faust #define __NR_io_uring_setup 425 75*4b9c6d91SCole Faust #endif 76*4b9c6d91SCole Faust 77*4b9c6d91SCole Faust #ifndef __NR_faccessat2 78*4b9c6d91SCole Faust #define __NR_faccessat2 439 79*4b9c6d91SCole Faust #endif 80*4b9c6d91SCole Faust 81*4b9c6d91SCole Faust #ifndef __NR_rseq 82*4b9c6d91SCole Faust #ifdef __x86_64__ 83*4b9c6d91SCole Faust #define __NR_rseq 334 84*4b9c6d91SCole Faust #elif __i386__ 85*4b9c6d91SCole Faust #define __NR_rseq 386 86*4b9c6d91SCole Faust #elif __arm64__ 87*4b9c6d91SCole Faust #define __NR_rseq 293 88*4b9c6d91SCole Faust #endif 89*4b9c6d91SCole Faust #endif /* __NR_rseq */ 90*4b9c6d91SCole Faust 91*4b9c6d91SCole Faust #ifndef __NR_clone3 92*4b9c6d91SCole Faust #define __NR_clone3 435 93*4b9c6d91SCole Faust #endif 94*4b9c6d91SCole Faust 95*4b9c6d91SCole Faust #ifndef __NR_userfaultfd 96*4b9c6d91SCole Faust #ifdef __x86_64__ 97*4b9c6d91SCole Faust #define __NR_userfaultfd 323 98*4b9c6d91SCole Faust #elif __i386__ 99*4b9c6d91SCole Faust #define __NR_userfaultfd 374 100*4b9c6d91SCole Faust #elif __arm64__ 101*4b9c6d91SCole Faust #define __NR_userfaultfd 282 102*4b9c6d91SCole Faust #endif 103*4b9c6d91SCole Faust #endif /* __NR_userfaultfd */ 104*4b9c6d91SCole Faust 105*4b9c6d91SCole Faust #ifndef __NR_membarrier 106*4b9c6d91SCole Faust #ifdef __x86_64__ 107*4b9c6d91SCole Faust #define __NR_membarrier 324 108*4b9c6d91SCole Faust #elif __i386__ 109*4b9c6d91SCole Faust #define __NR_membarrier 375 110*4b9c6d91SCole Faust #elif __arm64__ 111*4b9c6d91SCole Faust #define __NR_membarrier 283 112*4b9c6d91SCole Faust #endif 113*4b9c6d91SCole Faust #endif /* __NR_membarrier */ 114