]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
syscall_wrappers: rename internal memfd_create to memfd_create_lxc 3168/head
authorPatrick Havelange <patrick.havelange@essensium.com>
Tue, 22 Oct 2019 10:29:54 +0000 (12:29 +0200)
committerPatrick Havelange <patrick.havelange@essensium.com>
Tue, 22 Oct 2019 11:58:30 +0000 (13:58 +0200)
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.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
src/lxc/syscall_wrappers.h

index ce67da5b53081c42bcb0a4c979aa739f5f641121..b7edba63f5d78e3684a41f6f593dbe6ad0395709 100644 (file)
@@ -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