1 /* SPDX-License-Identifier: MIT */
2 #define _DEFAULT_SOURCE
3
4 /*
5 * Functions in this file require libc, only build them when we use libc.
6 *
7 * Note:
8 * liburing's tests still need these functions.
9 */
10 #if defined(CONFIG_NOLIBC) && !defined(LIBURING_BUILD_TEST)
11 #error "This file should only be compiled for libc build, or for liburing tests"
12 #endif
13
14 /*
15 * Will go away once libc support is there
16 */
17 #include <unistd.h>
18 #include <sys/syscall.h>
19 #include <sys/uio.h>
20 #include "liburing/compat.h"
21 #include "liburing/io_uring.h"
22 #include "syscall.h"
23
__sys_io_uring_register(int fd,unsigned opcode,const void * arg,unsigned nr_args)24 int __sys_io_uring_register(int fd, unsigned opcode, const void *arg,
25 unsigned nr_args)
26 {
27 return syscall(__NR_io_uring_register, fd, opcode, arg, nr_args);
28 }
29
__sys_io_uring_setup(unsigned entries,struct io_uring_params * p)30 int __sys_io_uring_setup(unsigned entries, struct io_uring_params *p)
31 {
32 return syscall(__NR_io_uring_setup, entries, p);
33 }
34
__sys_io_uring_enter2(int fd,unsigned to_submit,unsigned min_complete,unsigned flags,sigset_t * sig,int sz)35 int __sys_io_uring_enter2(int fd, unsigned to_submit, unsigned min_complete,
36 unsigned flags, sigset_t *sig, int sz)
37 {
38 return syscall(__NR_io_uring_enter, fd, to_submit, min_complete, flags,
39 sig, sz);
40 }
41
__sys_io_uring_enter(int fd,unsigned to_submit,unsigned min_complete,unsigned flags,sigset_t * sig)42 int __sys_io_uring_enter(int fd, unsigned to_submit, unsigned min_complete,
43 unsigned flags, sigset_t *sig)
44 {
45 return __sys_io_uring_enter2(fd, to_submit, min_complete, flags, sig,
46 _NSIG / 8);
47 }
48