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_error.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/libc/aio/aio_error.c (limited to 'lib/libc/aio/aio_error.c') diff --git a/lib/libc/aio/aio_error.c b/lib/libc/aio/aio_error.c new file mode 100644 index 00000000..27c7f134 --- /dev/null +++ b/lib/libc/aio/aio_error.c @@ -0,0 +1,26 @@ +#include <__aio.h> +#include +#include + +int aio_error(const struct aiocb *aiocbp) +{ + struct aio_request *req; + + if (aiocbp == NULL) { + errno = EINVAL; + return -1; + } + + req = __aio_lookup(aiocbp); + + if (req == NULL) { + errno = EINVAL; + return -1; + } + + if (req->status == AIO_REQUEST_STATUS_PENDING) { + return EINPROGRESS; + } + + return req->result < 0 ? -req->result : 0; +} -- cgit v1.2.3