Skip to main content

Thread: unix C api to get pid by passin a process name


i writin application in c++ in thread needs check whether process runnin or not ( based on need further work ).
there c api provided unix similar getpid takes process name , return me pid?

dont want make system call system( ps -a | grep <process name) since might slow application.

suggest.

to best of knowledge, there no c library function call can use query whether process running.

of course, can check using "ps -ef", , have output directed readable stream, using popen(). seems wanted avoid that.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk unix C api to get pid by passin a process name


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support