Ajout de l'exercice 1 et 2 du TP3
This commit is contained in:
12
TP3/Exo1/ex1-stdio.c
Normal file
12
TP3/Exo1/ex1-stdio.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
printf("NON");
|
||||
if (fork()) {
|
||||
printf("OUI\n");
|
||||
}
|
||||
}
|
14
TP3/Exo1/ex1-syscall.c
Normal file
14
TP3/Exo1/ex1-syscall.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
//printf("NON");
|
||||
write(STDOUT_FILENO,"NON",3);
|
||||
if (fork()) {
|
||||
//printf("OUI\n");
|
||||
write(STDOUT_FILENO,"OUI\n",4);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user