LinuxQuestions.org
Visit Jeremy's Blog.
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


Reply
  Search this Thread
Old 08-28-2008, 09:31 AM   #1
Pranav S
LQ Newbie
 
Registered: Apr 2008
Posts: 1

Rep: Reputation: 0
Sending signal to process & reading PID's


How can I send a signal to any process that is currently running on the system. I know we can use kill,Signal,sigaction to send a signal to another process by using desired process PID. But how can I get currently running process PID on the system? How can I accesss the kernel Data Structure that store the process ID and status information.
I know by combining pgrep, system and redirection operator we can have the PID's in file and then search for the desired process but is there any other way? Where I can do without invoking shell console. One more thing I want to ask is it good programming practice to invoke shell prompt in between a currently running C program? Does it affect the currently running process?

Thank You,
Pranav S
 
  


Reply



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
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 07:26 AM
Sending signal to child process DiAvOl Programming 6 05-16-2006 12:16 PM
Gtkmm - signal_button_press_event() not sending signal? matthurne Programming 1 12-19-2004 02:38 PM
Sending signal from one host to other zaheer031 Linux - Networking 1 11-04-2004 12:31 PM
Sending a signal to a process (Help me) rajesh_b Programming 2 09-17-2004 01:30 AM

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

All times are GMT -5. The time now is 03:31 AM.

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