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
|