1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
From b1694cccddadc8b084cd9eb502d9e86e0728709b Mon Sep 17 00:00:00 2001
From: Patrick Havelange <patrick.havelange@essensium.com>
Date: Tue, 22 Oct 2019 12:29:54 +0200
Subject: [PATCH v2] syscall_wrappers: rename internal memfd_create to
memfd_create_lxc
In case the internal memfd_create has to be used, make sure we don't
clash with the already existing memfd_create function from glibc.
This can happen if this glibc function is a stub. In this case, at
./configure time, the test for this function will return false, however
the declaration of that function is still available. This leads to
compilation errors.
Upstream-Status: Backport [lxc-3.2.1 https://github.com/lxc/lxc/pull/3168]
Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
(cherry picked from commit 40b06c78773dfd5e12e568a576b1abb133f61b71)
Signed-off-by: Oleksii Kurochko <olkuroch@cisco.com>
---
v2: added Upstream-Status
src/lxc/syscall_wrappers.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h
index ce67da5b5308..b7edba63f5d7 100644
--- a/src/lxc/syscall_wrappers.h
+++ b/src/lxc/syscall_wrappers.h
@@ -74,7 +74,7 @@ static inline long __keyctl(int cmd, unsigned long arg2, unsigned long arg3,
#endif
#ifndef HAVE_MEMFD_CREATE
-static inline int memfd_create(const char *name, unsigned int flags) {
+static inline int memfd_create_lxc(const char *name, unsigned int flags) {
#ifndef __NR_memfd_create
#if defined __i386__
#define __NR_memfd_create 356
@@ -113,6 +113,7 @@ static inline int memfd_create(const char *name, unsigned int flags) {
return -1;
#endif
}
+#define memfd_create memfd_create_lxc
#else
extern int memfd_create(const char *name, unsigned int flags);
#endif
|