File memfd-create.patch of Package vpp.9011

diff -Nuar vpp-18.01.old/src/configure.ac vpp-18.01.new/src/configure.ac
--- vpp-18.01.old/src/configure.ac	2018-01-24 07:22:24.000000000 +0100
+++ vpp-18.01.new/src/configure.ac	2018-03-06 09:20:30.445884588 +0100
@@ -227,6 +227,7 @@
 ###############################################################################
 # Dependency checks
 ###############################################################################
+AC_CHECK_FUNC([memfd_create], [AC_DEFINE([HAVE_MEMFD_CREATE], [1], [Define if memfd exists])])
 
 AM_COND_IF([ENABLE_DPDK_SHARED],
 [
diff -Nuar vpp-18.01.old/src/svm/memfd.h vpp-18.01.new/src/svm/memfd.h
--- vpp-18.01.old/src/svm/memfd.h	2018-01-24 07:22:24.000000000 +0100
+++ vpp-18.01.new/src/svm/memfd.h	2018-03-06 09:22:32.766903886 +0100
@@ -18,6 +18,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
+#undef __USE_GNU
+#define __USE_GNU 1
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <netinet/in.h>
@@ -174,9 +176,12 @@
 #ifndef F_LINUX_SPECIFIC_BASE
 #define F_LINUX_SPECIFIC_BASE 1024
 #endif
+
+#ifndef HAVE_MEMFD_CREATE
 #define MFD_ALLOW_SEALING       0x0002U
 #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
 #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
+#endif
 
 #define F_SEAL_SEAL     0x0001	/* prevent further seals from being set */
 #define F_SEAL_SHRINK   0x0002	/* prevent file from shrinking */
diff -Nuar vpp-18.01.old/src/vppinfra/linux/syscall.h vpp-18.01.new/src/vppinfra/linux/syscall.h
--- vpp-18.01.old/src/vppinfra/linux/syscall.h	2018-01-24 07:22:24.000000000 +0100
+++ vpp-18.01.new/src/vppinfra/linux/syscall.h	2018-03-06 09:21:18.142279323 +0100
@@ -39,11 +39,13 @@
   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 */
 
openSUSE Build Service is sponsored by