change OS name
This commit is contained in:
parent
c1a3e1601e
commit
3c4e3c952f
@ -3,20 +3,31 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
int main()
|
||||
{
|
||||
pid_t fpid;
|
||||
|
||||
fpid = fork();
|
||||
// create child process
|
||||
if (fpid < 0) {
|
||||
printf("error in fork!");
|
||||
} else if (fpid == 0) {
|
||||
if (fpid == -1)
|
||||
{
|
||||
perror("perror in fork!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (fpid == 0)
|
||||
{
|
||||
printf("I am the child process, my process id is %d\n", getpid());
|
||||
sleep(10);
|
||||
} else {
|
||||
sleep(1);
|
||||
printf("child process DONE\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("I am the parent process, my process id is %d\n", getpid());
|
||||
wait(NULL);
|
||||
// exit(0);
|
||||
printf("parent process DONE\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
return 0;
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
BIN
TP2/tableau/bubbleSort.o
Executable file
BIN
TP2/tableau/bubbleSort.o
Executable file
Binary file not shown.
BIN
TP2/tableau/quickSort.o
Executable file
BIN
TP2/tableau/quickSort.o
Executable file
Binary file not shown.
BIN
TP3/List/a.out
Executable file
BIN
TP3/List/a.out
Executable file
Binary file not shown.
7
langage_C.code-workspace
Normal file
7
langage_C.code-workspace
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user