update formatting
This commit is contained in:
parent
c3c04b7697
commit
7321708c66
@ -13,15 +13,13 @@ int main() {
|
||||
memcpy(shmem, parent_message, sizeof(parent_message));
|
||||
|
||||
int pid = fork();
|
||||
|
||||
if (pid == 0) {
|
||||
printf("Child read: %s\n", (char*)shmem);
|
||||
memcpy(shmem, child_message, sizeof(child_message));
|
||||
printf("Child wrote: %s\n", (char*)shmem);
|
||||
|
||||
printf("Child read: %s\n", (char*)shmem);
|
||||
memcpy(shmem, child_message, sizeof(child_message));
|
||||
printf("Child wrote: %s\n", (char*)shmem);
|
||||
} else {
|
||||
printf("Parent read: %s\n", (char*)shmem);
|
||||
sleep(1);
|
||||
printf("After 1s, parent read: %s\n", (char*)shmem);
|
||||
printf("Parent read: %s\n", (char*)shmem);
|
||||
sleep(1);
|
||||
printf("After 1s, parent read: %s\n", (char*)shmem);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user