The Pedigree Project 0.1
signal-timer-contract-test/contract.h
1#ifndef SIGNAL_TIMER_CONTRACT_H
2#define SIGNAL_TIMER_CONTRACT_H
3
4#include <signal.h>
5#include <stdint.h>
6#include <stdio.h>
7#include <time.h>
8
9#include <sys/types.h>
10
11#define CHECK(condition) \
12 do { \
13 if (!(condition)) { \
14 fprintf(stderr, "%s:%d: %s (errno=%d)\n", __FILE__, __LINE__, #condition, errno); \
15 failed = 1; \
16 goto out; \
17 } \
18 } while (0)
19
20int64_t st_now(clockid_t clock);
21struct timespec st_timespec(int64_t nanoseconds);
22void st_pause(int milliseconds);
23int st_wait(volatile int* flag, int milliseconds);
24int st_reap(pid_t child, int milliseconds);
25int signal_timer_test_signals(void);
26int signal_timer_test_timers(void);
27int signal_timer_test_cpu_itimers(void);
28int signal_timer_test_clock(void);
29int signal_timer_test_raw_clock(void);
30int signal_timer_exec(int argc, char** argv);
31
32#endif