add TP03 SCR
This commit is contained in:
6
SCR/SCR3.1/TP03/Exercise2/answer.txt
Normal file
6
SCR/SCR3.1/TP03/Exercise2/answer.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
[baudrier@salle229-06 Exercise2]$ gcc ex1-stdio.c
|
||||
[baudrier@salle229-06 Exercise2]$ ./a.out
|
||||
NONOUI
|
||||
NON[baudrier@salle229-06 Exercise2]$ gcc ex1-syscall.c
|
||||
[baudrier@salle229-06 Exercise2]$ ./a.out
|
||||
NONOUI
|
12
SCR/SCR3.1/TP03/Exercise2/ex1-stdio.c
Normal file
12
SCR/SCR3.1/TP03/Exercise2/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
SCR/SCR3.1/TP03/Exercise2/ex1-syscall.c
Normal file
14
SCR/SCR3.1/TP03/Exercise2/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