summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/generic/syscall.h12
-rw-r--r--src/arch/x86/syscall.h12
-rw-r--r--src/nolibc.c4
-rw-r--r--src/register.c4
-rw-r--r--src/setup.c22
5 files changed, 27 insertions, 27 deletions
diff --git a/src/arch/generic/syscall.h b/src/arch/generic/syscall.h
index 6b10fe3..fa93064 100644
--- a/src/arch/generic/syscall.h
+++ b/src/arch/generic/syscall.h
@@ -41,7 +41,7 @@ static inline int ____sys_io_uring_enter(int fd, unsigned to_submit,
_NSIG / 8);
}
-static inline void *uring_mmap(void *addr, size_t length, int prot, int flags,
+static inline void *__sys_mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset)
{
void *ret;
@@ -49,35 +49,35 @@ static inline void *uring_mmap(void *addr, size_t length, int prot, int flags,
return (ret == MAP_FAILED) ? ERR_PTR(-errno) : ret;
}
-static inline int uring_munmap(void *addr, size_t length)
+static inline int __sys_munmap(void *addr, size_t length)
{
int ret;
ret = munmap(addr, length);
return (ret < 0) ? -errno : ret;
}
-static inline int uring_madvise(void *addr, size_t length, int advice)
+static inline int __sys_madvise(void *addr, size_t length, int advice)
{
int ret;
ret = madvise(addr, length, advice);
return (ret < 0) ? -errno : ret;
}
-static inline int uring_getrlimit(int resource, struct rlimit *rlim)
+static inline int __sys_getrlimit(int resource, struct rlimit *rlim)
{
int ret;
ret = getrlimit(resource, rlim);
return (ret < 0) ? -errno : ret;
}
-static inline int uring_setrlimit(int resource, const struct rlimit *rlim)
+static inline int __sys_setrlimit(int resource, const struct rlimit *rlim)
{
int ret;
ret = setrlimit(resource, rlim);
return (ret < 0) ? -errno : ret;
}
-static inline int uring_close(int fd)
+static inline int __sys_close(int fd)
{
int ret;
ret = close(fd);
diff --git a/src/arch/x86/syscall.h b/src/arch/x86/syscall.h
index 2d5642c..02677f2 100644
--- a/src/arch/x86/syscall.h
+++ b/src/arch/x86/syscall.h
@@ -29,7 +29,7 @@
* %r11 == %rflags and %rcx == %rip.
*/
-static inline void *uring_mmap(void *addr, size_t length, int prot, int flags,
+static inline void *__sys_mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset)
{
void *rax;
@@ -52,7 +52,7 @@ static inline void *uring_mmap(void *addr, size_t length, int prot, int flags,
return rax;
}
-static inline int uring_munmap(void *addr, size_t length)
+static inline int __sys_munmap(void *addr, size_t length)
{
long rax;
@@ -67,7 +67,7 @@ static inline int uring_munmap(void *addr, size_t length)
return (int) rax;
}
-static inline int uring_madvise(void *addr, size_t length, int advice)
+static inline int __sys_madvise(void *addr, size_t length, int advice)
{
long rax;
@@ -83,7 +83,7 @@ static inline int uring_madvise(void *addr, size_t length, int advice)
return (int) rax;
}
-static inline int uring_getrlimit(int resource, struct rlimit *rlim)
+static inline int __sys_getrlimit(int resource, struct rlimit *rlim)
{
long rax;
@@ -98,7 +98,7 @@ static inline int uring_getrlimit(int resource, struct rlimit *rlim)
return (int) rax;
}
-static inline int uring_setrlimit(int resource, const struct rlimit *rlim)
+static inline int __sys_setrlimit(int resource, const struct rlimit *rlim)
{
long rax;
@@ -113,7 +113,7 @@ static inline int uring_setrlimit(int resource, const struct rlimit *rlim)
return (int) rax;
}
-static inline int uring_close(int fd)
+static inline int __sys_close(int fd)
{
long rax;
diff --git a/src/nolibc.c b/src/nolibc.c
index f7848d3..1e17d22 100644
--- a/src/nolibc.c
+++ b/src/nolibc.c
@@ -27,7 +27,7 @@ void *__uring_malloc(size_t len)
{
struct uring_heap *heap;
- heap = uring_mmap(NULL, sizeof(*heap) + len, PROT_READ | PROT_WRITE,
+ heap = __sys_mmap(NULL, sizeof(*heap) + len, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (IS_ERR(heap))
return NULL;
@@ -44,5 +44,5 @@ void __uring_free(void *p)
return;
heap = container_of(p, struct uring_heap, user_p);
- uring_munmap(heap, heap->len);
+ __sys_munmap(heap, heap->len);
}
diff --git a/src/register.c b/src/register.c
index a1b1a22..cd73fce 100644
--- a/src/register.c
+++ b/src/register.c
@@ -100,13 +100,13 @@ static int increase_rlimit_nofile(unsigned nr)
int ret;
struct rlimit rlim;
- ret = uring_getrlimit(RLIMIT_NOFILE, &rlim);
+ ret = __sys_getrlimit(RLIMIT_NOFILE, &rlim);
if (ret < 0)
return ret;
if (rlim.rlim_cur < nr) {
rlim.rlim_cur += nr;
- uring_setrlimit(RLIMIT_NOFILE, &rlim);
+ __sys_setrlimit(RLIMIT_NOFILE, &rlim);
}
return 0;
diff --git a/src/setup.c b/src/setup.c
index 1e4dbf4..544adaf 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -10,9 +10,9 @@
static void io_uring_unmap_rings(struct io_uring_sq *sq, struct io_uring_cq *cq)
{
- uring_munmap(sq->ring_ptr, sq->ring_sz);
+ __sys_munmap(sq->ring_ptr, sq->ring_sz);
if (cq->ring_ptr && cq->ring_ptr != sq->ring_ptr)
- uring_munmap(cq->ring_ptr, cq->ring_sz);
+ __sys_munmap(cq->ring_ptr, cq->ring_sz);
}
static int io_uring_mmap(int fd, struct io_uring_params *p,
@@ -29,7 +29,7 @@ static int io_uring_mmap(int fd, struct io_uring_params *p,
sq->ring_sz = cq->ring_sz;
cq->ring_sz = sq->ring_sz;
}
- sq->ring_ptr = uring_mmap(0, sq->ring_sz, PROT_READ | PROT_WRITE,
+ sq->ring_ptr = __sys_mmap(0, sq->ring_sz, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_POPULATE, fd,
IORING_OFF_SQ_RING);
if (IS_ERR(sq->ring_ptr))
@@ -38,7 +38,7 @@ static int io_uring_mmap(int fd, struct io_uring_params *p,
if (p->features & IORING_FEAT_SINGLE_MMAP) {
cq->ring_ptr = sq->ring_ptr;
} else {
- cq->ring_ptr = uring_mmap(0, cq->ring_sz, PROT_READ | PROT_WRITE,
+ cq->ring_ptr = __sys_mmap(0, cq->ring_sz, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_POPULATE, fd,
IORING_OFF_CQ_RING);
if (IS_ERR(cq->ring_ptr)) {
@@ -57,7 +57,7 @@ static int io_uring_mmap(int fd, struct io_uring_params *p,
sq->array = sq->ring_ptr + p->sq_off.array;
size = p->sq_entries * sizeof(struct io_uring_sqe);
- sq->sqes = uring_mmap(0, size, PROT_READ | PROT_WRITE,
+ sq->sqes = __sys_mmap(0, size, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_POPULATE, fd, IORING_OFF_SQES);
if (IS_ERR(sq->sqes)) {
ret = PTR_ERR(sq->sqes);
@@ -109,18 +109,18 @@ int io_uring_ring_dontfork(struct io_uring *ring)
return -EINVAL;
len = *ring->sq.kring_entries * sizeof(struct io_uring_sqe);
- ret = uring_madvise(ring->sq.sqes, len, MADV_DONTFORK);
+ ret = __sys_madvise(ring->sq.sqes, len, MADV_DONTFORK);
if (ret < 0)
return ret;
len = ring->sq.ring_sz;
- ret = uring_madvise(ring->sq.ring_ptr, len, MADV_DONTFORK);
+ ret = __sys_madvise(ring->sq.ring_ptr, len, MADV_DONTFORK);
if (ret < 0)
return ret;
if (ring->cq.ring_ptr != ring->sq.ring_ptr) {
len = ring->cq.ring_sz;
- ret = uring_madvise(ring->cq.ring_ptr, len, MADV_DONTFORK);
+ ret = __sys_madvise(ring->cq.ring_ptr, len, MADV_DONTFORK);
if (ret < 0)
return ret;
}
@@ -139,7 +139,7 @@ int io_uring_queue_init_params(unsigned entries, struct io_uring *ring,
ret = io_uring_queue_mmap(fd, p, ring);
if (ret) {
- uring_close(fd);
+ __sys_close(fd);
return ret;
}
@@ -166,9 +166,9 @@ void io_uring_queue_exit(struct io_uring *ring)
struct io_uring_sq *sq = &ring->sq;
struct io_uring_cq *cq = &ring->cq;
- uring_munmap(sq->sqes, *sq->kring_entries * sizeof(struct io_uring_sqe));
+ __sys_munmap(sq->sqes, *sq->kring_entries * sizeof(struct io_uring_sqe));
io_uring_unmap_rings(sq, cq);
- uring_close(ring->ring_fd);
+ __sys_close(ring->ring_fd);
}
struct io_uring_probe *io_uring_get_probe_ring(struct io_uring *ring)