wrap riscv_hwprobe(2)
authorAurelien Jarno <aurel32@debian.org>
Wed, 12 Mar 2025 13:33:48 +0000 (14:33 +0100)
committerMarco d'Itri <md@linux.it>
Wed, 12 Mar 2025 13:33:48 +0000 (14:33 +0100)
Gbp-Pq: Name fix_riscv64_tests

testsuite/init_module.c

index 6d39fdbaa43f15a94b5863f5e60535e5c83b52ef..45b22734bb2c84b96b821cdf8762eb90dabf2f9f 100644 (file)
@@ -364,6 +364,19 @@ TS_EXPORT long int syscall(long int __sysno, ...)
                return nextlib_syscall(__NR_gettid);
        }
 
+#ifdef __NR_riscv_hwprobe
+       if (__sysno == __NR_riscv_hwprobe) {
+               /*
+                * RISC-V Hardware Probing Interface. This might be used by
+                * some libraries (e.g. openssl) to probe the hardware
+                * capabilities. Just pretend the syscall doesn't exist, this
+                * will just fallback to less optimized code.
+                */
+               errno = ENOSYS;
+               return -1;
+       }
+#endif
+
        /*
         * FIXME: no way to call the libc function due since this is a
         * variadic argument function and we don't have a vsyscall() variant