Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!kuhub.cc.ukans.edu!jian From: jian@kuhub.cc.ukans.edu Newsgroups: comp.unix.questions Subject: what the kill() system call should do?? Message-ID: <25784.2700d355@kuhub.cc.ukans.edu> Date: 26 Sep 90 21:12:04 GMT Organization: University of Kansas Academic Computing Services Lines: 47 I tried to send a signal (SIGUSR1) from a child process to its parent process by using kill() system call in C. The result was funny. Whenever the parent process received the signal, it died immediately. I don't know what goes wrong in my program. Any help appreciated. Jian Q. Li jian@kuhub.cc.ukans.edu ---------------------------------------------------------------------------- Following is my sample program: void parent_process() { int ppid; .... switch( pid = fork()) { case -1: perror("for()"); exit(1); case 0: ppid = getpid(); child_process(ppid); default: signal(SIGUSR1, catch_usr1); } ..... } void catch_usr1() { printf("Catch the SIGUSR1 signal\n"); usr_break = 1; } void child_process(parent_id) int parent_id; { .... kill(parent_id, SIGUSR1); .... }