glibc 2.27 fix 69/10969/2
authorMarco Varlese <marco.varlese@suse.com>
Tue, 6 Mar 2018 07:09:04 +0000 (08:09 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Tue, 6 Mar 2018 13:11:18 +0000 (13:11 +0000)
With glibc 2.27 the memfd_create has been added to the devel libraries.
That's causing the internally defined static function to clash with the
system wide one. This patch addresses that issue on systems with latest
glibc libraries.

Change-Id: I788bf49b23d5b5f1cb1c0374e243d8a429178a71
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
src/configure.ac
src/vppinfra/linux/syscall.h

index 857bd01..d9c8a47 100644 (file)
@@ -234,6 +234,7 @@ PLUGIN_ENABLED(stn)
 ###############################################################################
 # Dependency checks
 ###############################################################################
+AC_CHECK_FUNC([memfd_create], [AC_DEFINE([HAVE_MEMFD_CREATE], [1], [Define if memfd exists])])
 
 AM_COND_IF([ENABLE_DPDK_SHARED],
 [
index f8ec591..4511b85 100644 (file)
@@ -39,11 +39,13 @@ move_pages (int pid, unsigned long count, void **pages, const int *nodes,
   return syscall (__NR_move_pages, pid, count, pages, nodes, status, flags);
 }
 
+#ifndef HAVE_MEMFD_CREATE
 static inline int
 memfd_create (const char *name, unsigned int flags)
 {
   return syscall (__NR_memfd_create, name, flags);
 }
+#endif
 
 #endif /* included_linux_syscall_h */