From: Sangeetha <sangeetha.elumalai@timesys.com>
Date: Thu, 26 Jun 2025 12:07:12 +0530

diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index f207738..8c59fdd 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -71,6 +71,28 @@
 #include <util/os_file.h>
 #endif
 
+#ifndef HAVE_MEMFD_CREATE
+#include <sys/syscall.h>
+
+static inline int
+memfd_create(const char *name, unsigned int flags)
+{
+   return syscall(SYS_memfd_create, name, flags);
+}
+#endif
+
+#ifndef MFD_ALLOW_SEALING
+#define MFD_ALLOW_SEALING	0x0002U
+#endif
+
+#ifndef F_ADD_SEALS
+#define F_ADD_SEALS       1033
+#endif
+
+#ifndef F_SEAL_SHRINK
+#define F_SEAL_SHRINK	0x0002	/* prevent file from shrinking */
+#endif
+
 #if MESA_DEBUG
 static struct llvmpipe_resource resource_list;
 static simple_mtx_t resource_list_mutex = SIMPLE_MTX_INITIALIZER;
-- 
2.25.1

