Βοήθεια που κάνω λάθος?

Ανώνυμος (χωρίς επαλήθευση) | Κυρ, 01/13/2008 - 23:30 | 2'

#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
 
 
void catch_alarm(int sig_num) {

 
    printf('Child proccess will Exit..
');        & nbsp;         & nbsp;         

    exit(0);

 
}

 
void myfunc(int sig) {

    signal(SIGALRM, catch_alarm);

    alarm(15);         
    while (1) {

        printf('I am the child
');       
        }                   
 }                              
 
int main(){

 
int  pid;

signal(SIGALRM, catch_alarm);

pid = fork();

if (pid = 0) {

    while (1) {

        printf('I am the child
');     

    }                   

     
} else {

    if (!pid == 0) {

        sleep(3);              

        printf('Mypid is : %d
',getpid());   

        signal(SIGINT,myfunc);

    }

}

}

Δώσε αστέρια!

MO: (ψήφοι: 0)