bsd.cfg: Added support for setbuffer() and setlinebuf().

This commit is contained in:
orbitcowboy 2022-04-27 10:22:38 +02:00
parent 53ebb55e1f
commit fa1182c0f1
2 changed files with 45 additions and 0 deletions

View File

@ -218,6 +218,36 @@
<valid>0:</valid> <valid>0:</valid>
</arg> </arg>
</function> </function>
<!-- https://linux.die.net/man/3/setbuffer -->
<!-- void setbuffer(FILE *stream, char *buf, size_t size); -->
<function name="setbuffer">
<returnValue type="void"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="inout">
<not-null/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
</function>
<!-- https://linux.die.net/man/3/setbuffer -->
<!-- void setlinebuf(FILE *stream); -->
<function name="setlinebuf">
<returnValue type="void"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="inout">
<not-null/>
<not-uninit/>
</arg>
</function>
<!-- https://linux.die.net/man/2/writev --> <!-- https://linux.die.net/man/2/writev -->
<!-- ssize_t readv(int fd, const struct iovec *iov, int iovcnt); --> <!-- ssize_t readv(int fd, const struct iovec *iov, int iovcnt); -->
<function name="readv"> <function name="readv">

View File

@ -12,6 +12,21 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/uio.h> #include <sys/uio.h>
void nullPointer_setbuffer(FILE *stream, char *buf, size_t size)
{
// cppcheck-suppress nullPointer
(void) setbuffer(NULL, buf, size);
(void) setbuffer(stream, NULL, size);
(void) setbuffer(stream, buf, size);
}
void nullPointer_setlinebuf(FILE *stream)
{
// cppcheck-suppress nullPointer
(void)setlinebuf(NULL);
(void)setlinebuf(stream);
}
// #9323, #9331 // #9323, #9331
void verify_timercmp(struct timeval t) void verify_timercmp(struct timeval t)
{ {