This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 1ea86e65fd2f64293cc2855963d5fc801ad82aad
Author: Xiang Xiao <[email protected]>
AuthorDate: Fri Sep 11 02:21:22 2026 +0800

    aio: make the lio_listio() prototype match POSIX
    
    POSIX declares lio_listio() as:
    
      int lio_listio(int, struct aiocb *restrict const [restrict], int,
                     struct sigevent *restrict);
    
    Update the prototype in include/aio.h (and the implementation and
    libc.csv entry) accordingly, and drop the parameter names from the
    other aio_* prototypes for consistency.
    
    Signed-off-by: guoshichao <[email protected]>
---
 fs/aio/lio_listio.c | 10 ++++++----
 include/aio.h       | 20 ++++++++++----------
 libs/libc/libc.csv  |  2 +-
 3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/fs/aio/lio_listio.c b/fs/aio/lio_listio.c
index d0316649c39..1edbf7c7e25 100644
--- a/fs/aio/lio_listio.c
+++ b/fs/aio/lio_listio.c
@@ -66,7 +66,8 @@
  *
  ****************************************************************************/
 
-static int lio_checkio(FAR struct aiocb * const *list, int nent)
+static int lio_checkio(FAR struct aiocb *restrict const *restrict list,
+                       int nent)
 {
   FAR struct aiocb *aiocbp;
   int ret;
@@ -131,7 +132,8 @@ static int lio_checkio(FAR struct aiocb * const *list, int 
nent)
  *
  ****************************************************************************/
 
-static int lio_waitall(FAR struct aiocb * const *list, int nent)
+static int lio_waitall(FAR struct aiocb *restrict const *restrict list,
+                       int nent)
 {
   sigset_t set;
   int ret;
@@ -320,8 +322,8 @@ static int lio_waitall(FAR struct aiocb * const *list, int 
nent)
  *
  ****************************************************************************/
 
-int lio_listio(int mode, FAR struct aiocb * const list[], int nent,
-               FAR struct sigevent *sig)
+int lio_listio(int mode, FAR struct aiocb *restrict const list[restrict],
+               int nent, FAR struct sigevent *restrict sig)
 {
   FAR struct aiocb *aiocbp = NULL;
   struct list_node head;
diff --git a/include/aio.h b/include/aio.h
index 7afb86116a9..81dcddd962b 100644
--- a/include/aio.h
+++ b/include/aio.h
@@ -155,16 +155,16 @@ extern "C"
  * Public Function Prototypes
  ****************************************************************************/
 
-int aio_cancel(int fildes, FAR struct aiocb *aiocbp);
-int aio_error(FAR const struct aiocb *aiocbp);
-int aio_fsync(int op, FAR struct aiocb *aiocbp);
-int aio_read(FAR struct aiocb *aiocbp);
-ssize_t aio_return(FAR struct aiocb *aiocbp);
-int aio_suspend(FAR const struct aiocb * const list[], int nent,
-                FAR const struct timespec *timeout);
-int aio_write(FAR struct aiocb *aiocbp);
-int lio_listio(int mode, FAR struct aiocb * const list[], int nent,
-               FAR struct sigevent *sig);
+int aio_cancel(int, FAR struct aiocb *);
+int aio_error(FAR const struct aiocb *);
+int aio_fsync(int, FAR struct aiocb *);
+int aio_read(FAR struct aiocb *);
+ssize_t aio_return(FAR struct aiocb *);
+int aio_suspend(FAR const struct aiocb * const[], int,
+                FAR const struct timespec *);
+int aio_write(FAR struct aiocb *);
+int lio_listio(int, FAR struct aiocb *restrict const[restrict], int,
+               FAR struct sigevent *restrict);
 
 #undef EXTERN
 #ifdef __cplusplus
diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv
index 2e2d13506cf..2cf17ac4b15 100644
--- a/libs/libc/libc.csv
+++ b/libs/libc/libc.csv
@@ -157,7 +157,7 @@
 "labs","stdlib.h","","long int","long int"
 "lib_dumpbuffer","debug.h","","void","FAR const char *","FAR const uint8_t 
*","unsigned int"
 "lib_get_stream","nuttx/tls.h","","FAR struct file_struct *","int"
-"lio_listio","aio.h","defined(CONFIG_FS_AIO)","int","int","FAR struct aiocb * 
const []|FAR struct aiocb * const *","int","FAR struct sigevent *"
+"lio_listio","aio.h","defined(CONFIG_FS_AIO)","int","int","FAR struct aiocb 
*restrict const [restrict]|FAR struct aiocb *restrict const 
*restrict","int","FAR struct sigevent *restrict"
 "llabs","stdlib.h","","long long int","long long int"
 "localtime","time.h","","struct tm *","const time_t *"
 "localtime_r","time.h","","FAR struct tm *","FAR const time_t *","FAR struct 
tm *"

Reply via email to