Blame SOURCES/0739-missing-when-adding-syscall-replacements-use-differe.patch

17b0f1
From 2cbb8dd0984e46b8650678c69f426d06e37c117b Mon Sep 17 00:00:00 2001
17b0f1
From: Frantisek Sumsal <fsumsal@redhat.com>
17b0f1
Date: Thu, 4 Apr 2019 11:23:59 +0200
17b0f1
Subject: [PATCH] missing: when adding syscall replacements, use different
17b0f1
 names
17b0f1
17b0f1
Based on 5187dd2c403caf92d09f3491e41f1ceb3f10491f
17b0f1
17b0f1
Resolves: #1694605
17b0f1
---
17b0f1
 src/shared/missing.h | 40 ++++++++++++++++++++++++++++++----------
17b0f1
 1 file changed, 30 insertions(+), 10 deletions(-)
17b0f1
17b0f1
diff --git a/src/shared/missing.h b/src/shared/missing.h
17b0f1
index a7771bc996..4596b2b494 100644
17b0f1
--- a/src/shared/missing.h
17b0f1
+++ b/src/shared/missing.h
17b0f1
@@ -127,9 +127,11 @@
17b0f1
 #endif
17b0f1
 
17b0f1
 #if !HAVE_DECL_PIVOT_ROOT
17b0f1
-static inline int pivot_root(const char *new_root, const char *put_old) {
17b0f1
+static inline int missing_pivot_root(const char *new_root, const char *put_old) {
17b0f1
         return syscall(SYS_pivot_root, new_root, put_old);
17b0f1
 }
17b0f1
+
17b0f1
+#define pivot_root missing_pivot_root
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef __NR_memfd_create
17b0f1
@@ -197,13 +199,15 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef HAVE_FANOTIFY_INIT
17b0f1
-static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags) {
17b0f1
+static inline int missing_fanotify_init(unsigned int flags, unsigned int event_f_flags) {
17b0f1
         return syscall(__NR_fanotify_init, flags, event_f_flags);
17b0f1
 }
17b0f1
+
17b0f1
+#define fanotify_init missing_fanotify_init
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef HAVE_FANOTIFY_MARK
17b0f1
-static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t mask,
17b0f1
+static inline int missing_fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t mask,
17b0f1
                                 int dfd, const char *pathname) {
17b0f1
 #if defined _MIPS_SIM && _MIPS_SIM == _MIPS_SIM_ABI32 || defined __powerpc__ && !defined __powerpc64__ \
17b0f1
     || defined __arm__ && !defined __aarch64__
17b0f1
@@ -219,12 +223,16 @@ static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t ma
17b0f1
         return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, pathname);
17b0f1
 #endif
17b0f1
 }
17b0f1
+
17b0f1
+#define fanotify_mark missing_fanotify_mark
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef HAVE_MEMFD_CREATE
17b0f1
-static inline int memfd_create(const char *name, unsigned int flags) {
17b0f1
+static inline int missing_memfd_create(const char *name, unsigned int flags) {
17b0f1
         return syscall(__NR_memfd_create, name, flags);
17b0f1
 }
17b0f1
+
17b0f1
+#define memfd_create missing_memfd_create
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef __NR_getrandom
17b0f1
@@ -261,9 +269,11 @@ static inline int memfd_create(const char *name, unsigned int flags) {
17b0f1
 #endif
17b0f1
 
17b0f1
 #if !HAVE_DECL_GETRANDOM
17b0f1
-static inline int getrandom(void *buffer, size_t count, unsigned flags) {
17b0f1
+static inline int missing_getrandom(void *buffer, size_t count, unsigned flags) {
17b0f1
         return syscall(__NR_getrandom, buffer, count, flags);
17b0f1
 }
17b0f1
+
17b0f1
+#define getrandom missing_getrandom
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef GRND_NONBLOCK
17b0f1
@@ -529,9 +539,11 @@ struct btrfs_ioctl_clone_range_args {
17b0f1
 #endif
17b0f1
 
17b0f1
 #if !HAVE_DECL_GETTID
17b0f1
-static inline pid_t gettid(void) {
17b0f1
+static inline pid_t missing_gettid(void) {
17b0f1
         return (pid_t) syscall(SYS_gettid);
17b0f1
 }
17b0f1
+
17b0f1
+#define gettid missing_gettid
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef SCM_SECURITY
17b0f1
@@ -583,9 +595,11 @@ struct file_handle {
17b0f1
         unsigned char f_handle[0];
17b0f1
 };
17b0f1
 
17b0f1
-static inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
17b0f1
+static inline int missing_name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
17b0f1
         return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
17b0f1
 }
17b0f1
+
17b0f1
+#define name_to_handle_at missing_name_to_handle_at
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef HAVE_SECURE_GETENV
17b0f1
@@ -647,9 +661,11 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle
17b0f1
 #endif
17b0f1
 
17b0f1
 #if !HAVE_DECL_SETNS
17b0f1
-static inline int setns(int fd, int nstype) {
17b0f1
+static inline int missing_setns(int fd, int nstype) {
17b0f1
         return syscall(__NR_setns, fd, nstype);
17b0f1
 }
17b0f1
+
17b0f1
+#define setns missing_setns
17b0f1
 #endif
17b0f1
 
17b0f1
 #if !HAVE_DECL_LO_FLAGS_PARTSCAN
17b0f1
@@ -986,9 +1002,11 @@ static inline pid_t raw_getpid(void) {
17b0f1
 #  endif
17b0f1
 #endif
17b0f1
 
17b0f1
-static inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
17b0f1
+static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
17b0f1
         return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags);
17b0f1
 }
17b0f1
+
17b0f1
+#define renameat2 missing_renameat2
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef RENAME_NOREPLACE
17b0f1
@@ -996,9 +1014,11 @@ static inline int renameat2(int oldfd, const char *oldname, int newfd, const cha
17b0f1
 #endif
17b0f1
 
17b0f1
 #if !HAVE_DECL_KCMP
17b0f1
-static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
17b0f1
+static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
17b0f1
         return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
17b0f1
 }
17b0f1
+
17b0f1
+#define kcmp missing_kcmp
17b0f1
 #endif
17b0f1
 
17b0f1
 #ifndef KCMP_FILE