chiark
/
gitweb
/
~ian
/
map-unshare.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fix typo, thanks to kees
[map-unshare.git]
/
simple-test.c
1
#include "map-unshare.h"
2
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <assert.h>
6
7
static void dumpmaps(void) {
8
FILE *maps = fopen("/proc/self/maps","r");
9
int c;
10
while ((c=getc(maps)) != EOF) putchar(c);
11
assert(!ferror(maps) && !fclose(maps));
12
assert(!fflush(stdout) && !ferror(stdout));
13
}
14
15
int main(void) {
16
dumpmaps();
17
map_unshare();
18
dumpmaps();
19
exit(0);
20
}