Skip to content

Commit 5a3d84d

Browse files
committed
posix.cfg: Added support for aio_read()
1 parent e0942c1 commit 5a3d84d

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

cfg/posix.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
<not-bool/>
1515
</arg>
1616
</function>
17+
<!-- https://man7.org/linux/man-pages/man3/aio_read.3.html -->
18+
<!-- int aio_read(struct aiocb *aiocbp); -->
19+
<function name="aio_read">
20+
<use-retval/>
21+
<returnValue type="int"/>
22+
<noreturn>false</noreturn>
23+
<leak-ignore/>
24+
<arg nr="1" direction="inout">
25+
<not-null/>
26+
<not-bool/>
27+
</arg>
28+
</function>
1729
<!-- https://man7.org/linux/man-pages/man3/aio_suspend.3.html -->
1830
<!-- int aio_suspend(const struct aiocb *const aiocb_list[], int nitems, const struct timespec *restrict timeout); -->
1931
<function name="aio_suspend">

test/cfg/posix.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
#include <wchar.h>
3131
#include <string.h>
3232

33+
int nullPointer_aio_read(struct aiocb *aiocbp)
34+
{
35+
// cppcheck-suppress nullPointer
36+
(void)aio_read(NULL);
37+
// No warning is expected
38+
return aio_read(aiocbp);
39+
}
40+
3341
int nullPointer_aio_suspend(const struct aiocb *const aiocb_list[], int nitems, const struct timespec *restrict timeout)
3442
{
3543
// cppcheck-suppress nullPointer

0 commit comments

Comments
 (0)