The Pedigree Project
0.1
src
user
applications
file-resize-contract-test
file-resize-contract-test/contract.h
1
#ifndef FILE_RESIZE_CONTRACT_H
2
#define FILE_RESIZE_CONTRACT_H
3
4
#include <errno.h>
5
#include <stdint.h>
6
#include <stdio.h>
7
8
#include <sys/types.h>
9
10
#define CHECK(condition) \
11
do { \
12
if (!(condition)) { \
13
fprintf(stderr, "%s:%d: %s (errno=%d)\n", __FILE__, __LINE__, #condition, errno); \
14
failed = 1; \
15
goto out; \
16
} \
17
} while (0)
18
19
enum
{ FR_MEMFD, FR_RAMFS, FR_EXT2 };
20
struct
fr_file
{
21
int
fd;
22
int
backend;
23
char
path[128];
24
};
25
26
extern
size_t
fr_page;
27
int
fr_create(
struct
fr_file
* file,
int
backend);
28
int
fr_open_alias(
const
struct
fr_file
* file);
29
void
fr_close(
struct
fr_file
* file);
30
unsigned
char
fr_pattern(
size_t
offset);
31
int
fr_matches(
const
volatile
unsigned
char
* bytes,
size_t
offset,
size_t
length,
int
zero);
32
int
fr_contents(
int
fd,
size_t
offset,
size_t
length,
int
zero);
33
int
fr_size(
int
fd,
size_t
size);
34
int
fr_resident(
void
* address,
size_t
pages,
unsigned
bits,
const
char
* stage);
35
int
fr_send(
int
fd,
char
byte
);
36
int
fr_receive(
int
fd,
char
byte
);
37
int
fr_reap(pid_t child,
int
milliseconds);
38
int
fr_fault(
void
* address);
39
int
fr_shared(
int
backend);
40
int
fr_private(
int
backend);
41
int
fr_seals(
void
);
42
43
#endif
fr_file
Definition
file-resize-contract-test/contract.h:20
Generated on Tue Sep 29 2026 04:30:13 for The Pedigree Project by
1.9.8