aboutsummaryrefslogtreecommitdiff
path: root/src/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall.c')
-rw-r--r--src/syscall.c44
1 files changed, 14 insertions, 30 deletions
diff --git a/src/syscall.c b/src/syscall.c
index 2fd3dd4..362f1f5 100644
--- a/src/syscall.c
+++ b/src/syscall.c
@@ -2,6 +2,16 @@
#define _DEFAULT_SOURCE
/*
+ * Functions in this file require libc, only build them when we use libc.
+ *
+ * Note:
+ * liburing's tests still need these functions.
+ */
+#if defined(CONFIG_NOLIBC) && !defined(LIBURING_BUILD_TEST)
+#error "This file should only be compiled for libc build, or for liburing tests"
+#endif
+
+/*
* Will go away once libc support is there
*/
#include <unistd.h>
@@ -11,32 +21,6 @@
#include "liburing/io_uring.h"
#include "syscall.h"
-#ifdef __alpha__
-/*
- * alpha is the only exception, all other architectures
- * have common numbers for new system calls.
- */
-# ifndef __NR_io_uring_setup
-# define __NR_io_uring_setup 535
-# endif
-# ifndef __NR_io_uring_enter
-# define __NR_io_uring_enter 536
-# endif
-# ifndef __NR_io_uring_register
-# define __NR_io_uring_register 537
-# endif
-#else /* !__alpha__ */
-# ifndef __NR_io_uring_setup
-# define __NR_io_uring_setup 425
-# endif
-# ifndef __NR_io_uring_enter
-# define __NR_io_uring_enter 426
-# endif
-# ifndef __NR_io_uring_register
-# define __NR_io_uring_register 427
-# endif
-#endif
-
int __sys_io_uring_register(int fd, unsigned opcode, const void *arg,
unsigned nr_args)
{
@@ -49,15 +33,15 @@ int __sys_io_uring_setup(unsigned entries, struct io_uring_params *p)
}
int __sys_io_uring_enter2(int fd, unsigned to_submit, unsigned min_complete,
- unsigned flags, sigset_t *sig, int sz)
+ unsigned flags, sigset_t *sig, int sz)
{
- return syscall(__NR_io_uring_enter, fd, to_submit, min_complete,
- flags, sig, sz);
+ return syscall(__NR_io_uring_enter, fd, to_submit, min_complete, flags,
+ sig, sz);
}
int __sys_io_uring_enter(int fd, unsigned to_submit, unsigned min_complete,
unsigned flags, sigset_t *sig)
{
return __sys_io_uring_enter2(fd, to_submit, min_complete, flags, sig,
- _NSIG / 8);
+ _NSIG / 8);
}