LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-17-2004, 09:08 PM   #1
THETEZ
LQ Newbie
 
Registered: Mar 2004
Distribution: Redhat 9
Posts: 6

Rep: Reputation: 0
question about kill(pid, sig)


what value should i use to kill all children from the parent?

0 -1 or less than -1
 
Old 04-17-2004, 09:38 PM   #2
nodger
Member
 
Registered: Oct 2003
Location: Ireland
Distribution: Slackware 9.1, Ubuntu
Posts: 192

Rep: Reputation: 30
I dont know but if you do a search on Google youll find the answer in about 30 seconds. Whats that you say? you already found it?
 
Old 04-17-2004, 09:44 PM   #3
THETEZ
LQ Newbie
 
Registered: Mar 2004
Distribution: Redhat 9
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by nodger
I dont know but if you do a search on Google youll find the answer in about 30 seconds. Whats that you say? you already found it?
you know this because you found the answer in about 30 seconds? if so what is it

whats that you say? still searching?

Last edited by THETEZ; 04-17-2004 at 11:22 PM.
 
Old 04-18-2004, 05:37 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Re: question about kill(pid, sig)

Quote:
Originally posted by THETEZ
what value should i use to kill all children from the parent?
When calling fork() it returns that pid of the child. If you save those pid's, say, to an array of pid's you can kill them looping through the array.

Or you could loop through all pid's in /proc, killing all processes that have their parent ID set to the pid of the parent (which you can get with getpid())

I think there's no "special way" to do this.
 
  


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
kill <pid> does not do anything moskito01 Linux - General 9 08-25-2009 12:20 PM
PID Kill Script or command ? Webmin rapture_1 Linux - General 1 11-02-2005 11:11 AM
question about pics in sig SSJ2VEGETA LQ Suggestions & Feedback 9 02-03-2005 01:12 PM
when kill -9 PID wont work bleunuit Linux - Software 2 08-06-2004 11:46 AM
small bash script to kill a PID flosch Linux - General 3 05-06-2004 09:28 PM


All times are GMT -5. The time now is 08:42 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration