The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3168

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
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.havela...@essensium.com>
From 40b06c78773dfd5e12e568a576b1abb133f61b71 Mon Sep 17 00:00:00 2001
From: Patrick Havelange <patrick.havela...@essensium.com>
Date: Tue, 22 Oct 2019 12:29:54 +0200
Subject: [PATCH] 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.

Signed-off-by: Patrick Havelange <patrick.havela...@essensium.com>
---
 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 ce67da5b53..b7edba63f5 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
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to