You've already forked devops-exercises
Rename exercises dir
Name it instead "topics" so it won't be strange if some topics included "exercises" directory.
This commit is contained in:
17
topics/os/fork_101.md
Normal file
17
topics/os/fork_101.md
Normal file
@@ -0,0 +1,17 @@
|
||||
## Fork 101
|
||||
|
||||
Answer the questions given the following program (without running it):
|
||||
|
||||
```
|
||||
#include<stdio.h>
|
||||
#include <unistd.h>
|
||||
int main()
|
||||
{
|
||||
fork();
|
||||
printf("\nyay\n");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
1. How many times the word "yay" will be printed?
|
||||
2. How many processes will be created?
|
||||
19
topics/os/fork_102.md
Normal file
19
topics/os/fork_102.md
Normal file
@@ -0,0 +1,19 @@
|
||||
## Fork 101
|
||||
|
||||
Answer the questions given the following program (without running it):
|
||||
|
||||
```
|
||||
#include<stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
fork();
|
||||
fork();
|
||||
printf("\nyay\n");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
1. How many times the word "yay" will be printed?
|
||||
2. How many processes will be created?
|
||||
4
topics/os/solutions/fork_101_solution.md
Normal file
4
topics/os/solutions/fork_101_solution.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## Fork 101 - Solution
|
||||
|
||||
1. 2
|
||||
2. 2
|
||||
4
topics/os/solutions/fork_102_solution.md
Normal file
4
topics/os/solutions/fork_102_solution.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## Fork 102 - Solution
|
||||
|
||||
1. 4
|
||||
2. 4
|
||||
Reference in New Issue
Block a user