posix.cfg: Fixed #9323, #9331 by adding timercmp() configuration.

This commit is contained in:
orbitcowboy 2019-09-07 10:42:09 +02:00
parent 59fdbd8435
commit 12c851d9a8
2 changed files with 29 additions and 0 deletions

View File

@ -726,6 +726,26 @@ The obsolescent function 'usleep' is called. POSIX.1-2001 declares usleep() func
<not-uninit/>
</arg>
</function>
<!-- int timercmp(struct timeval *a, struct timeval *b, CMP)-->
<function name="timercmp">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="int"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
</arg>
</function>
<!-- int timercmp(struct timeval *a, struct timeval *b, CMP)-->
<define name="timercmp(a,b,CMP)" value="(((a)-&gt;tv_sec == (b)-&gt;tv_sec) ? ((a)-&gt;tv_usec CMP (b)-&gt;tv_usec) : ((a)-&gt;tv_sec CMP (b)-&gt;tv_sec))"/>
<!-- http://man7.org/linux/man-pages/man3/dirfd.3.html -->
<!-- int dirfd(DIR *dirp); -->
<function name="dirfd">

View File

@ -12,6 +12,7 @@
#include <dirent.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <dlfcn.h>
#include <fcntl.h>
// unavailable on some linux systems #include <ndbm.h>
@ -23,6 +24,14 @@
#include <syslog.h>
#include <stdarg.h>
// #9323, #9331
void verify_timercmp(struct timeval t)
{
(void)timercmp(&t, &t, <);
(void)timercmp(&t, &t, >);
(void)timercmp(&t, &t, !=);
}
void memleak_scandir(void)
{
struct dirent **namelist;