diff options
author | Colin Cross <ccross@android.com> | 2022-12-21 09:48:40 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2022-12-21 11:26:51 -0800 |
commit | 45b8aa469386ff5a39c322cb5447f8d42d8ee385 (patch) | |
tree | d822e37661fac3bd1d0381d2166737e621e3bdff | |
parent | 74b0aeb2ceb8ca5c1bd6309eb6920a9b90580e8c (diff) | |
download | minijail-45b8aa469386ff5a39c322cb5447f8d42d8ee385.tar.gz |
minijail: add local definitions of MADV_FREE and __NR_membarrier
MADV_FREE and __NR_membarrier are used internally by musl libc and
therefore added to the crosvm seccomp policies by b/258117555, but
are not defined by the old glibc prebuilts in the Android platform.
Add defines for MADV_FREE and __NR_mmebarrier to gen_constants-inl.h
and gen_syscalls-inl.h.
Bug: 263152407
Test: launch_cvd --cpus=4 --memory_mb=4096 --console=true --enable_sandbox=true --base_instance_num=1 --report_anonymous_usage_stats=n --undefok=base_instance_num,console,enable_sandbox,report_anonymous_usage_stats
Change-Id: I9633e7403f924cdf454c9dc3bebae7740f621091
-rw-r--r-- | gen_constants-inl.h | 4 | ||||
-rw-r--r-- | gen_syscalls-inl.h | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gen_constants-inl.h b/gen_constants-inl.h index f5fdd29..d09349c 100644 --- a/gen_constants-inl.h +++ b/gen_constants-inl.h @@ -73,3 +73,7 @@ struct fscrypt_policy_v1 { #if !defined(FS_IOC_GET_ENCRYPTION_POLICY_EX) #define FS_IOC_GET_ENCRYPTION_POLICY_EX _IOWR('f', 22, __u8[9]) #endif + +#if !defined(MADV_FREE) +#define MADV_FREE 8 +#endif diff --git a/gen_syscalls-inl.h b/gen_syscalls-inl.h index 7a2f230..aee71e2 100644 --- a/gen_syscalls-inl.h +++ b/gen_syscalls-inl.h @@ -92,3 +92,13 @@ #endif #endif /* __NR_rseq */ + +#ifndef __NR_membarrier +#ifdef __x86_64__ +#define __NR_membarrier 324 +#elif __i386__ +#define __NR_membarrier 375 +#elif __arm64__ +#define __NR_membarrier 283 +#endif +#endif /* __NR_membarrier */ |