#9323, #9331: Moved configuration and tests to gnu and bsd.

This commit is contained in:
orbitcowboy 2019-09-08 19:17:15 +02:00
parent bb54e455ce
commit aed5e17867
6 changed files with 140 additions and 67 deletions

View File

@ -1,5 +1,63 @@
<?xml version="1.0"?>
<def format="2">
<!-- int timerisset(struct timeval *tvp); -->
<function name="timerisset">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="int"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
</function>
<!-- void timerclear(struct timeval *tvp); -->
<function name="timerclear">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="inout">
<not-null/>
</arg>
</function>
<!-- void timeradd(struct timeval *a, struct timeval *b, struct timeval *res);-->
<!-- void timersub(struct timeval *a, struct timeval *b, struct timeval *res);-->
<function name="timeradd,timersub">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="3" direction="out">
<not-null/>
</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))"/>
<!-- https://www.freebsd.org/cgi/man.cgi?query=fts&sektion=3 -->
<!-- FTS * fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT * const *, const FTSENT * const *)); -->
<function name="fts_open">

View File

@ -89,6 +89,64 @@
<not-uninit/>
</arg>
</function>
<!-- int timerisset(struct timeval *tvp); -->
<function name="timerisset">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="int"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
</function>
<!-- void timerclear(struct timeval *tvp); -->
<function name="timerclear">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="inout">
<not-null/>
</arg>
</function>
<!-- void timeradd(struct timeval *a, struct timeval *b, struct timeval *res);-->
<!-- void timersub(struct timeval *a, struct timeval *b, struct timeval *res);-->
<function name="timeradd,timersub">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="3" direction="out">
<not-null/>
</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))"/>
<!-- int __builtin_types_compatible_p (type1, type2) -->
<function name="__builtin_types_compatible_p">
<noreturn>false</noreturn>

View File

@ -726,64 +726,6 @@ The obsolescent function 'usleep' is called. POSIX.1-2001 declares usleep() func
<not-uninit/>
</arg>
</function>
<!-- int timerisset(struct timeval *tvp); -->
<function name="timerisset">
<noreturn>false</noreturn>
<leak-ignore/>
<use-retval/>
<returnValue type="int"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
</function>
<!-- void timerclear(struct timeval *tvp); -->
<function name="timerclear">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="inout">
<not-null/>
</arg>
</function>
<!-- void timeradd(struct timeval *a, struct timeval *b, struct timeval *res);-->
<!-- void timersub(struct timeval *a, struct timeval *b, struct timeval *res);-->
<function name="timeradd,timersub">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="void"/>
<arg nr="1" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<not-null/>
</arg>
<arg nr="3" direction="out">
<not-null/>
</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

@ -9,6 +9,18 @@
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/time.h>
// #9323, #9331
void verify_timercmp(struct timeval t)
{
(void)timercmp(&t, &t, <);
(void)timercmp(&t, &t, <=);
(void)timercmp(&t, &t, ==);
(void)timercmp(&t, &t, !=);
(void)timercmp(&t, &t, >=);
(void)timercmp(&t, &t, >);
}
// size_t strlcat(char *dst, const char *src, size_t size);
void uninitvar_strlcat(char *Ct, const char *S, size_t N)

View File

@ -11,10 +11,22 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/time.h>
#ifndef __CYGWIN__
#include <sys/epoll.h>
#endif
// #9323, #9331
void verify_timercmp(struct timeval t)
{
(void)timercmp(&t, &t, <);
(void)timercmp(&t, &t, <=);
(void)timercmp(&t, &t, ==);
(void)timercmp(&t, &t, !=);
(void)timercmp(&t, &t, >=);
(void)timercmp(&t, &t, >);
}
// Declaration necessary because there is no specific / portable header.
extern void *xcalloc(size_t nmemb, size_t size);
extern void *xmalloc(size_t size);

View File

@ -12,7 +12,6 @@
#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>
@ -24,14 +23,6 @@
#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;