From 051512dd487ce8d071c2d147ae160d01d86f1709 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 22 Apr 2022 07:41:03 +0200 Subject: [PATCH] bsd.cfg: Added support for pwritev(), preadv(), writev() and writev(). --- cfg/bsd.cfg | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ test/cfg/bsd.c | 29 +++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/cfg/bsd.cfg b/cfg/bsd.cfg index 69b079718..0d2553202 100644 --- a/cfg/bsd.cfg +++ b/cfg/bsd.cfg @@ -218,6 +218,92 @@ 0: + + + + + + + + + 0: + + + + + + + + 0: + + + + + + + + + + + 0: + + + + + + + + 0: + + + + + + + + + + + 0: + + + + + + + + 0: + + + + + 0: + + + + + + + + + + + 0: + + + + + + + + 0: + + + + + 0: + + diff --git a/test/cfg/bsd.c b/test/cfg/bsd.c index 8ab7e9640..d150c6ab3 100644 --- a/test/cfg/bsd.c +++ b/test/cfg/bsd.c @@ -10,6 +10,7 @@ #include #include #include +#include // #9323, #9331 void verify_timercmp(struct timeval t) @@ -22,6 +23,34 @@ void verify_timercmp(struct timeval t) (void)timercmp(&t, &t, >); } +ssize_t nullPointer_readv(int fd, const struct iovec *iov, int iovcnt) +{ + // cppcheck-suppress nullPointer + (void)readv(fd,NULL,iovcnt); + return readv(fd,iov,iovcnt); +} + +ssize_t nullPointer_writev(int fd, const struct iovec *iov, int iovcnt) +{ + // cppcheck-suppress nullPointer + (void)writev(fd,NULL,iovcnt); + return writev(fd,iov,iovcnt); +} + +ssize_t nullPointer_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset) +{ + // cppcheck-suppress nullPointer + (void)preadv(fd,NULL,iovcnt,offset); + return preadv(fd,iov,iovcnt,offset); +} + +ssize_t nullPointer_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset) +{ + // cppcheck-suppress nullPointer + (void)pwritev(fd,NULL,iovcnt,offset); + return pwritev(fd,iov,iovcnt,offset); +} + // False negative: #9346 void uninitvar_timercmp(struct timeval t) {