posix.cfg: Added support for pwrite().

This commit is contained in:
orbitcowboy 2022-04-26 09:26:39 +02:00
parent bb98ccf7d4
commit 942375741b
2 changed files with 32 additions and 0 deletions

View File

@ -2126,6 +2126,31 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </function>
<!-- https://man7.org/linux/man-pages/man3/write.3p.html -->
<!-- ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); -->
<function name="pwrite">
<returnValue type="ssize_t"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="in">
<valid>0:</valid>
<not-uninit/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- ssize_t recv(int sockfd, void *buf, size_t len, int flags); --> <!-- ssize_t recv(int sockfd, void *buf, size_t len, int flags); -->
<function name="recv"> <function name="recv">
<returnValue type="ssize_t"/> <returnValue type="ssize_t"/>

View File

@ -31,6 +31,13 @@
#include <wchar.h> #include <wchar.h>
#include <string.h> #include <string.h>
ssize_t nullPointer_pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
{
// cppcheck-suppress nullPointer
(void)pwrite(fd,NULL,nbyte,offset);
return pwrite(fd,buf,nbyte,offset);
}
int nullPointer_ttyname_r(int fd, char *buf, size_t buflen) int nullPointer_ttyname_r(int fd, char *buf, size_t buflen)
{ {
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer