get info about a specific process
Hello,
I want to get information about a specific process automatically. I can get these infos from the /proc/PID/status file. But my problem is that the process that I want to get its info could take no time to execute . If I have a program named foo, when I want to get its info, I use this command : Code:
./foo | cat /proc/`/sbin/pidof foo`/status So my question is : How can I pause the program foo, until I can get its info, then kill foo ? Regards, hfawzy |
There is another file, wtmp, that is written if accounting is enabled.
It records process creation, deletion times, etc. Has the same format as utmp. The information is not lost. See the man pages for getutent or utmp. |
get info of a process
i want a simple c code for pausing the process which doesnot use the kill command because i want to do some process programming but there is not much help available..
please help. |
for pausing u can use sleep() command ... sleep(1) sleeps for a second...and similarly for slee(2) and so on... bud don know it is recommanded to ur situation or not....
|
well using the sleep() command is also a solution to the problem..
but i wanted to have a better approach in terms of programming, like for example using the process link list and using the task_struct to access the task and then setting the status field to pause.. i know the theory but i am unable to do the programming. please reply. |
All times are GMT -5. The time now is 01:13 PM. |