Skip to content

Instantly share code, notes, and snippets.

🤦‍♂️
working!

Cristóbal Acosta morsoinferno

🤦‍♂️
working!
View GitHub Profile
View fork3.c
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
int num;
pid_t pid;
View anillo.c
// lista circular - procesos y pipes
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#define MAX_P 2
#define MAX_BUFFER 100
View codigo_control_3.c
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define MAX_THREADS 5
int i, sum;
enum {THREAD_FAIL, THREAD_SUCCESS};
void *runner(void *param){
View 07_execv.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int main()
{
pid_t pid;
int status;
View 06_dup2.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <sys/types.h>
#include <sys/wait.h>
void main()
{
int fd[2];
View 05_dup1.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
void main()
{
int fd;
fd = dup2(1, 200);
close(STDOUT_FILENO);
View 04_pipe2.c
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
void main()
{
pid_t pid;
int fd[2];
int msg_length;
View 03_pipe1.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
void main()
{
int fd[2];
int msg_length;
char msg[100];
View 02_fork2.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#define NFORKS 100
void do_nothing(){
sleep(10); // 10 second
View 01_fork1.c
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
pid_t fork(void);
pid_t getpid(void);
pid_t getppid(void);
You can’t perform that action at this time.