diff --git a/.vscode/ipch/102df1d42b7a3ca4/mmap_address.bin b/.vscode/ipch/102df1d42b7a3ca4/mmap_address.bin new file mode 100644 index 000000000..862b8428b Binary files /dev/null and b/.vscode/ipch/102df1d42b7a3ca4/mmap_address.bin differ diff --git a/ex1/a.out b/ex1/a.out new file mode 100644 index 000000000..45578286e Binary files /dev/null and b/ex1/a.out differ diff --git a/ex1/ex1.c b/ex1/ex1.c index c4b111641..5c8d768dd 100644 --- a/ex1/ex1.c +++ b/ex1/ex1.c @@ -8,7 +8,22 @@ int main(void) { - // Your code here + int x=100; + printf("Main process id is: %d, value of x is: %d", (int)getpid(), x); + int rc= fork(); + if (rc < 0) + { + printf("Forking failed \n"); + } + else if (rc == 0) + { + printf("Main process id is: %d, value of x is: %d", (int)getpid(), x); + } + else + { + int x = 200; + printf("Main process id is: %d, value of x is: %d", (int)getpid(), x); + } return 0; } diff --git a/ex1/main b/ex1/main new file mode 100644 index 000000000..45578286e Binary files /dev/null and b/ex1/main differ