Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vscode/ipch/102df1d42b7a3ca4/mmap_address.bin
Binary file not shown.
Binary file added ex1/a.out
Binary file not shown.
17 changes: 16 additions & 1 deletion ex1/ex1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Binary file added ex1/main
Binary file not shown.