Processo em background
Esse script deixa o programa rodando em background utilizando o fork.
Descrição
Esse script deixa o programa rodando em background utilizando o fork.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(){
int time = 100;
pid_t pid;
pid = fork();
if( pid )
exit(0);
fprintf(stdout,"Programa em background por: %i segundos\n",time);
usleep(time*1000000);
fprintf(stdout,"\n[+] Fim\n");
exit(0);
}