FreeBSD regtest: add fakes for older versions in scalar
[valgrind.git] / memcheck / tests / freebsd / bug483786.c
blobdc5a734718cc6110aeec5bfb2c75b35cf23cc0ef
1 #include "../../memcheck.h"
2 #include <time.h>
4 /* should complain about rqtp and rmtp */
5 void valgrind_should_complain(void)
7 struct timespec ts_uninitialized = {0};
9 VALGRIND_MAKE_MEM_UNDEFINED(&ts_uninitialized, sizeof(ts_uninitialized));
11 clock_nanosleep(CLOCK_MONOTONIC, 0, &ts_uninitialized, &ts_uninitialized);
14 /* should have no complaints */
15 void valgrind_should_not_complain(void)
17 struct timespec ts_initialized = {0};
19 clock_nanosleep(CLOCK_MONOTONIC, 0, &ts_initialized, &ts_initialized);
22 /* should have no complaints */
23 void valgrind_should_not_complain2(void)
25 struct timespec ts_initialized = {0};
27 clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts_initialized,
28 &ts_initialized);
31 int main(int argc, char** argv)
34 valgrind_should_complain();
35 valgrind_should_not_complain();
36 valgrind_should_not_complain2();
38 return (0);