selftests/core: handle missing syscall number for close_range
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 18 Dec 2020 14:54:13 +0000 (15:54 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 19 Dec 2020 15:23:18 +0000 (16:23 +0100)
This improves the syscall number handling in the close_range()
selftests. This should handle any architecture.

Cc: Giuseppe Scrivano <gscrivan@redhat.com>
Cc: linux-fsdevel@vger.kernel.org
Link: https://lore.kernel.org/r/20201218145415.801063-2-christian.brauner@ubuntu.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
tools/testing/selftests/core/close_range_test.c

index c97dd1a..bc592a1 100644 (file)
 #include "../clone3/clone3_selftests.h"
 
 #ifndef __NR_close_range
-#define __NR_close_range -1
+       #if defined __alpha__
+               #define __NR_close_range 546
+       #elif defined _MIPS_SIM
+               #if _MIPS_SIM == _MIPS_SIM_ABI32        /* o32 */
+                       #define __NR_close_range (436 + 4000)
+               #endif
+               #if _MIPS_SIM == _MIPS_SIM_NABI32       /* n32 */
+                       #define __NR_close_range (436 + 6000)
+               #endif
+               #if _MIPS_SIM == _MIPS_SIM_ABI64        /* n64 */
+                       #define __NR_close_range (436 + 5000)
+               #endif
+       #elif defined __ia64__
+               #define __NR_close_range (436 + 1024)
+       #else
+               #define __NR_close_range 436
+       #endif
 #endif
 
 #ifndef CLOSE_RANGE_UNSHARE