Skip to contentSkip to conversation

um: Add definition of __NR_close_range for older host OSs

PATCH New Florian Fainelli 1 participant 1 message Aug 12 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 um: Add definition of __NR_close_range for older host OSs

__NR_close_range was introduced with 278a5fbaed89dacd04e9d052f4594ffd0e0585de ("open: add close_range()") which is present in Linux >= 5.9. Older hosts running a kernel version prior to that range currently fail to build due to that missing system call number definition.

Fixes f82a9e7b9fa9 ("um: fix execve stub execution on old host OSs")
---
 arch/um/include/shared/skas/stub-data.h | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/um/include/shared/skas/stub-data.h +9 -0
index 27db38e95df9..1230a325debc 100644
@@ -9,11 +9,20 @@
 #define __STUB_DATA_H
 
 #include <linux/compiler_types.h>
+#include <asm/unistd.h>
 #include <as-layout.h>
 #include <sysdep/tls.h>
 #include <sysdep/stub-data.h>
 #include <mm_id.h>
 
+#ifndef __NR_close_range
+# if defined(__alpha__)
+#  define __NR_close_range 546
+# else
+#  define __NR_close_range 436
+# endif
+#endif
+
 #define FUTEX_IN_CHILD 0
 #define FUTEX_IN_KERN 1
 
Signature · 1 line
2.34.1