LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-23-2001, 11:55 PM   #1
mukul
LQ Newbie
 
Registered: Mar 2001
Location: Bangalore
Posts: 1

Rep: Reputation: 0

how a forked child process can be killed by its parent
in a program ?
 
Old 03-24-2001, 11:55 AM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Arrow

fork() returns the pid of the child forked.

The child can be killed by calling kill( pid, SIGHUP ) on the child's pid.

There are several signals that will kill a process. SIGHUP is the 'kind' way to kill it. Some process do catch signals and are programmed to either ignore some signals or handle them in some other way. (like the inetd) Processes can most always be killed with a SIGKILL signal. If SIGABRT is used correctly it will cause a core dump. Usefull if you are debbugging.

You should rellay post questions like this in the programming section.

Hope this helps

Gary
 
Old 03-24-2001, 01:12 PM   #3
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,597

Rep: Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080Reputation: 4080
Quote:
You should rellay post questions like this in the programming section.
Very true, so I moved it
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GCC fork() - Can a child change a parent variable? johnhardey Programming 4 03-10-2005 10:49 AM
Getting a parent to communicate with its child -- fork() kamel Programming 3 06-02-2004 03:04 AM
parent and child processes skora Programming 5 11-02-2003 10:41 AM
about parent and child process winwar Solaris / OpenSolaris 3 07-23-2003 06:07 AM
child and parent process error jdevanand Programming 1 04-29-2002 08:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration