7 int main(int argc, char *argv[])
14 printf("shm_sample <size>\n");
20 buf = (int *)mmap(0, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED,
22 if (buf == (int *)-1) {
37 if (buf[0] != parent) {
38 printf("memory not shared? (buf[0]=%d parent=%d)\n", buf[0], parent);
40 printf("shared OK\n");