Lines Matching refs:smap
33 static int parent_f(int sock, unsigned long *smap, int child) in parent_f() argument
40 *smap = 0x22222BAD; in parent_f()
41 ret = msync(smap, MMAP_SZ, MS_SYNC); in parent_f()
53 static int child_f(int sock, unsigned long *smap, int fd) in child_f() argument
57 smap = mmap(0, MMAP_SZ, PROT_READ | PROT_WRITE, in child_f()
59 BUG_ON(smap == MAP_FAILED, "mmap()"); in child_f()
61 BUG_ON(*smap != 0xdeadbabe, "MAP_PRIVATE | MAP_POPULATE changed file"); in child_f()
69 BUG_ON(*smap == 0x22222BAD, "MAP_POPULATE didn't COW private page"); in child_f()
70 BUG_ON(*smap != 0xdeadbabe, "mapping was corrupted"); in child_f()
79 unsigned long *smap; in main() local
87 smap = mmap(0, MMAP_SZ, PROT_READ | PROT_WRITE, in main()
89 BUG_ON(smap == MAP_FAILED, "mmap()"); in main()
91 *smap = 0xdeadbabe; in main()
93 ret = msync(smap, MMAP_SZ, MS_SYNC); in main()
106 return parent_f(sock[1], smap, child); in main()
112 return child_f(sock[0], smap, fileno(ftmp)); in main()