repositories
/
TD_SE.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
thread-pid course code.
[TD_SE.git]
/
fils
/
fils.c
1
#include <unistd.h>
2
#include <stdio.h>
3
#include <sys/types.h>
4
5
int
main
() {
6
pid_t fils_pid
;
7
fils_pid
=
fork
();
8
9
if
(
fils_pid
==
0
) {
10
printf
(
"Je suis le fils avec pid %d
\n
"
,
getpid
());
11
}
else if
(
fils_pid
>
0
) {
12
printf
(
"Je suis le pere avec pid %d
\n
"
,
getpid
());
13
}
else
{
14
printf
(
"Erreur a la creation du fils
\n
"
);
15
}
16
}