1#ifndef UTS_NAMESPACE_CONTRACT_H
2#define UTS_NAMESPACE_CONTRACT_H
10#define NS_APP "/applications/uts-namespace-contract-test"
11#define CHECK(condition) \
14 fprintf(stderr, "%s:%d: %s (errno=%d)\n", __FILE__, __LINE__, #condition, errno); \
28#define NS_PEER_INITIALIZER {.pid = -1, .command = -1, .report = -1}
32int ns_reap(pid_t pid,
int milliseconds);
33int ns_read(
int fd,
void* buffer,
size_t length);
34int ns_write(
int fd,
const void* buffer,
size_t length);
35int ns_send(
int fd,
char value);
36int ns_receive(
int fd,
char value);
37int ns_spawn(
struct ns_peer* peer,
int (*body)(
int,
int,
void*),
void* argument);
38int ns_join(
struct ns_peer* peer);
39void ns_cleanup(
struct ns_peer* peer);
43int ns_set(
const char* host,
const char* domain);
44int ns_expect(
const char* host,
const char* domain);
45int ns_send_fd(
int socket,
int fd);
46int ns_receive_fd(
int socket);
48int ns_membership(
void);
51int ns_admission(
void);
52int ns_exec(
int argc,
char** argv);