Use a switch() statement for syscall override handling, making it a
little bit less verbose.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/387
+ switch (__sysno) {
+ case -1:
+#ifdef __NR_riscv_hwprobe
+ case __NR_riscv_hwprobe:
+#endif
errno = ENOSYS;
return -1;
errno = ENOSYS;
return -1;
- }
-
- if (__sysno == __NR_finit_module) {
+ case __NR_finit_module:
const char *args;
int flags;
int fd;
const char *args;
int flags;
int fd;
- }
-
- if (__sysno == __NR_gettid) {
static long (*nextlib_syscall)(long number, ...);
if (nextlib_syscall == NULL) {
static long (*nextlib_syscall)(long number, ...);
if (nextlib_syscall == NULL) {
return nextlib_syscall(__NR_gettid);
}
return nextlib_syscall(__NR_gettid);
}
-#ifdef __NR_riscv_hwprobe
- if (__sysno == __NR_riscv_hwprobe) {
- 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
/*
* FIXME: no way to call the libc function due since this is a
* variadic argument function and we don't have a vsyscall() variant