The Pedigree Project
0.1
src
user
applications
process-memory-contract-test
process-memory-contract-test/contract.h
1
#ifndef PROCESS_MEMORY_CONTRACT_H
2
#define PROCESS_MEMORY_CONTRACT_H
3
4
#include <errno.h>
5
#include <stdint.h>
6
#include <stdio.h>
7
8
#include <sys/types.h>
9
#include <sys/uio.h>
10
11
#define PM_APP "/applications/process-memory-contract-test"
12
#define CHECK(condition) \
13
do { \
14
if (!(condition)) { \
15
fprintf(stderr, "%s:%d: %s (errno=%d)\n", __FILE__, __LINE__, #condition, errno); \
16
failed = 1; \
17
goto out; \
18
} \
19
} while (0)
20
21
struct
pm_peer
{
22
pid_t pid;
23
int
command, report;
24
};
25
#define PM_PEER_INITIALIZER {.pid = -1, .command = -1, .report = -1}
26
27
extern
size_t
pm_page;
28
int64_t pm_now(
void
);
29
int
pm_reap(pid_t pid,
int
milliseconds);
30
int
pm_read(
int
fd,
void
* buffer,
size_t
length);
31
int
pm_write(
int
fd,
const
void
* buffer,
size_t
length);
32
int
pm_send(
int
fd,
char
command);
33
int
pm_receive(
int
fd,
char
command);
34
int
pm_spawn(
struct
pm_peer
* peer,
int
(*body)(
int
,
int
,
void
*),
void
* argument);
35
int
pm_join(
struct
pm_peer
* peer);
36
void
pm_cleanup(
struct
pm_peer
* peer);
37
int
pm_isolate(
int
(*body)(
void
));
38
ssize_t pm_copy(pid_t pid,
void
* local,
const
void
* remote,
size_t
length,
int
write_remote);
39
int
pm_dumpable(
int
value);
40
int
pm_copies(
void
);
41
int
pm_mappings(
void
);
42
int
pm_lifetime(
void
);
43
int
pm_credentials(
void
);
44
int
pm_filesystem(
void
);
45
int
pm_exec(
int
argc,
char
** argv);
46
int
pm_fs_exec(
int
argc,
char
** argv);
47
48
#endif
pm_peer
Definition
process-memory-contract-test/contract.h:21
Generated on Tue Sep 29 2026 04:30:13 for The Pedigree Project by
1.9.8