LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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


Closed Thread
  Search this Thread
Old 03-17-2022, 05:37 AM   #1
tuxuser1
Member
 
Registered: Nov 2021
Posts: 167

Rep: Reputation: Disabled
Accurate Child Process Monitoring in C


Hi,

I need to make an accurate monitoring of the child processes.

I have a signal handler which I can get the child data via siginfo_t structure hence its pid and I can understand
if it is exited, killed, stopped an so on.

If the child (for example PID 2) is killed by another process (for example PID 100), in my signal handler I only can get the pid 2
not 100 instead which it's caused its dead.

If I understand right, we can inspect the child behaviour via ptrace system call.

Ptrace could help me in this case, that is, trace the process which has caused its dead?

Regards
 
Old 03-17-2022, 05:43 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,159

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Duplicate - reported for closure.
 
  


Closed Thread



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
Fork child, send signal, kill child process. Need help aceLime Linux - Newbie 1 12-12-2018 07:04 AM
Difference between Child THREAD and Child PROCESS whho Linux - Newbie 12 02-16-2015 12:22 AM
Under which circumstances a child process creates another child process using fork? mitsulas Programming 3 12-08-2009 08:16 AM
How to kill a Child and all its subsequent child process in C shayer009 Programming 3 12-04-2007 12:40 AM
Killing a child process from another child marri Programming 6 10-01-2004 07:08 PM

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

All times are GMT -5. The time now is 05:02 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