zephyr/lib/posix/options/aio.c
Chris Friedt cdb1193f3e posix: add stubs for asynchronous io
Add stubs for POSIX asynchronous io that return -1 and set
errno to ENOTSUP.

The functions and structures in aio.h are required by the
_POSIX_ASYNCHRONOUS_IO Option as detailed in Section E.1 of
IEEE-1003.1-2017.

The _POSIX_ASYNCHRONOUS_IO interface is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 11:02:11 +02:00

82 lines
1.2 KiB
C

/*
* Copyright 2024 Tenstorrent AI ULC
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <signal.h>
#include <zephyr/posix/aio.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
ARG_UNUSED(fildes);
ARG_UNUSED(aiocbp);
errno = ENOSYS;
return -1;
}
int aio_error(const struct aiocb *aiocbp)
{
ARG_UNUSED(aiocbp);
errno = ENOSYS;
return -1;
}
int aio_fsync(int fildes, struct aiocb *aiocbp)
{
ARG_UNUSED(fildes);
ARG_UNUSED(aiocbp);
errno = ENOSYS;
return -1;
}
int aio_read(struct aiocb *aiocbp)
{
ARG_UNUSED(aiocbp);
errno = ENOSYS;
return -1;
}
ssize_t aio_return(struct aiocb *aiocbp)
{
ARG_UNUSED(aiocbp);
errno = ENOSYS;
return -1;
}
int aio_suspend(const struct aiocb *const list[], int nent, const struct timespec *timeout)
{
ARG_UNUSED(list);
ARG_UNUSED(nent);
ARG_UNUSED(timeout);
errno = ENOSYS;
return -1;
}
int aio_write(struct aiocb *aiocbp)
{
ARG_UNUSED(aiocbp);
errno = ENOSYS;
return -1;
}
int lio_listio(int mode, struct aiocb *const ZRESTRICT list[], int nent,
struct sigevent *ZRESTRICT sig)
{
ARG_UNUSED(mode);
ARG_UNUSED(list);
ARG_UNUSED(nent);
ARG_UNUSED(sig);
errno = ENOSYS;
return -1;
}