-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4613ba
commit b718910
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+333 KB
Linguagem_De_Programacao_IV/30-706 - Linguagem de Programação IV - Aula 2.pdf
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <unistd.h> | ||
#include <sys/wait.h> | ||
#include <sys/types.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main() | ||
{ | ||
pid_t pid, pid2; | ||
int estado; | ||
|
||
pid = fork(); /* Cria um PROCESSO */if (pid < 0) | ||
{ | ||
printf("Erro ao criar o processo\n"); | ||
exit(-1); | ||
} | ||
else if (pid > 0) /* Código que só vai ser executado pelo Processo PAI */ | ||
{ | ||
printf("Eu sou o PAI\n"); | ||
printf("Papai estah esperando vc...\n"); | ||
pid2 = wait(&estado); | ||
printf("To pronto pai!\n"); | ||
printf("O filho com o pid %d terminou\n", pid2); | ||
} | ||
else /* Código que só vai ser executado pelo Processo FILHO */ | ||
{ | ||
printf("Processo Filho\n"); | ||
} | ||
|
||
printf("REPETIDO\n"); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
p = fork(); | ||
|
||
a = fork(); | ||
|
||
|
||
|
||
printf("Linguagens IV\n"); | ||
|
||
?> |
Binary file added
BIN
+849 KB
Sistemas_Operacionais_II/38-113 - Sistemas Operacionais II - Aula 2.pdf
Binary file not shown.