1#ifndef EVENT_DESCRIPTOR_CONTRACT_H
2#define EVENT_DESCRIPTOR_CONTRACT_H
11#define CHECK(condition) \
14 fprintf(stderr, "%s:%d: %s (errno=%d)\n", __FILE__, __LINE__, #condition, errno); \
20#define EVENT_DESCRIPTOR_APP "/applications/event-descriptor-contract-test"
22int64_t ed_now(clockid_t clock);
23struct timespec ed_timespec(int64_t nanoseconds);
24void ed_pause(
int milliseconds);
25int ed_wait(
volatile int* flag,
int milliseconds);
26int ed_reap(pid_t child,
int milliseconds);
27int ed_send_fd(
int socket,
int fd);
28int ed_receive_fd(
int socket);
29int ed_readable(
int fd,
int milliseconds);
34 volatile int started, done;
38 unsigned char bytes[128];
40void* ed_read_thread(
void* argument);
42int event_descriptor_test_signalfd(
void);
43int event_descriptor_test_timerfd(
void);
44int event_descriptor_test_clock(
void);
45int event_descriptor_signalfd_exec(
int argc,
char** argv);
46int event_descriptor_timerfd_exec(
int argc,
char** argv);