From 3b3325f761b09ebbfef04c44eed546cc4fdeb329 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 15 Dec 2025 02:01:33 +0100 Subject: Added aio and eventfd support, along with sleep and yes utilities --- lib/libc/aio/aio_fsync.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/libc/aio/aio_fsync.c (limited to 'lib/libc/aio/aio_fsync.c') diff --git a/lib/libc/aio/aio_fsync.c b/lib/libc/aio/aio_fsync.c new file mode 100644 index 00000000..00d56b42 --- /dev/null +++ b/lib/libc/aio/aio_fsync.c @@ -0,0 +1,26 @@ +#include <__aio.h> +#include +#include +#include +#include + +int aio_fsync(int op, struct aiocb *aiocbp) +{ + int opcode; + struct aio_request *req; + + req = __aio_lookup(aiocbp); + + if (req == NULL) { + errno = EINVAL; + return -1; + } + + if (op == O_DSYNC) { + opcode = IORING_OP_FSYNC | IORING_FSYNC_DATASYNC; + } else { + opcode = IORING_OP_FSYNC; + } + + return __aio_request(req, opcode); +} -- cgit v1.2.3