- Código:
#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);
}
Participe do fórum, é rápido e fácil