Commit | Line | Data |
---|---|---|
ed423898 JB |
1 | #include <sys/types.h> |
2 | #include <sys/wait.h> | |
3 | ||
4 | #include <stdio.h> | |
5 | #include <stdlib.h> | |
6 | #include <string.h> | |
7 | #include <unistd.h> | |
8 | #include <time.h> | |
9 | ||
10 | int main() { | |
11 | ||
12 | srand(time(NULL)); | |
720c45c7 | 13 | int randvalue = rand() % 5 + 1; |
ed423898 JB |
14 | |
15 | printf("[%d] Je suis la balle et je vole\n", getpid()); | |
16 | ||
720c45c7 | 17 | sleep(randvalue); |
ed423898 | 18 | |
720c45c7 | 19 | return randvalue; |
ed423898 | 20 | } |