4 /* TODO: not thread-safe nor fork-safe */
5 extern volatile int t_status
;
7 #define T_LOC2(l) __FILE__ ":" #l
8 #define T_LOC1(l) T_LOC2(l)
9 #define t_error(...) t_printf(T_LOC1(__LINE__) ": " __VA_ARGS__)
11 int t_printf(const char *s
, ...);
13 int t_vmfill(void **, size_t *, int);
18 void t_randseed(uint64_t s
);
19 uint64_t t_randn(uint64_t n
);
20 uint64_t t_randint(uint64_t a
, uint64_t b
);
21 void t_shuffle(uint64_t *p
, size_t n
);
22 void t_randrange(uint64_t *p
, size_t n
);
23 int t_choose(uint64_t n
, size_t k
, uint64_t *p
);
25 char *t_pathrel(char *buf
, size_t n
, char *argv0
, char *p
);
27 int t_setrlim(int r
, long lim
);