LinuxQuestions.org
Review your favorite Linux distribution.
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 01-30-2009, 01:46 AM   #1
kulandaivelu
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Rep: Reputation: 0
Smile how to get the name of process from PID in C/C++?


hi,
Can anyone help me to find out name of the process from process ID in C/C++ program?

Thanks in Advance
Kulandaivelu.S
 
Old 01-30-2009, 05:25 AM   #2
irey
Member
 
Registered: Jun 2008
Location: Torino, Italy
Posts: 65

Rep: Reputation: 17
Take a look at /proc/<pid>/exe. It's a symlink to the binary that created the process.
 
Old 02-02-2009, 12:23 PM   #3
kulandaivelu
LQ Newbie
 
Registered: Jan 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Hi irey,

Thanks for reply..
 
Old 02-03-2009, 10:41 AM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
Tell your teacher hello for me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 to get the PID of the process giving kill signal to a process? hariprd Programming 2 11-27-2008 04:10 AM
pid of a process kushkothari Programming 8 11-19-2008 06:06 AM
[C++] Get process ID (PID) Moraxus Programming 5 10-16-2008 01:31 PM
Getting pid of a process!! vishamr2000 Programming 31 09-09-2005 09:46 PM
how to get more process' info according to its PID? iclinux Programming 1 02-05-2005 06:30 AM


All times are GMT -5. The time now is 10:59 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration