libs/libc/aio: fix aio_fsync compatible issue

1. make the aio_fsync implementation can pass the
ltp/open_posix_testsuite/aio_fsync testcases
2. the modification are referred to https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao 2023-06-09 19:36:43 +08:00 committed by Xiang Xiao
parent f5a2741ec2
commit d4dc0f6ec7

View File

@ -191,7 +191,12 @@ int aio_fsync(int op, FAR struct aiocb *aiocbp)
FAR struct aio_container_s *aioc;
int ret;
DEBUGASSERT(op == O_SYNC); /* || op == O_DSYNC */
if (op != O_SYNC)
{
set_errno(EINVAL);
return ERROR;
}
DEBUGASSERT(aiocbp);
/* The result -EINPROGRESS means that the transfer has not yet completed */