From 942375741b783fc7650413b464aa3e5dbc40ada1 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Tue, 26 Apr 2022 09:26:39 +0200 Subject: [PATCH] posix.cfg: Added support for pwrite(). --- cfg/posix.cfg | 25 +++++++++++++++++++++++++ test/cfg/posix.c | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index 92522f6cb..433de9dc1 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -2126,6 +2126,31 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s 0: + + + + + false + + + 0: + + + + + + + + + + + 0: + + + + + + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 05eace4c8..269daf93a 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -31,6 +31,13 @@ #include #include +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) { // cppcheck-suppress nullPointer