Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Process Name from PID

Posted on 1997-03-05
1
Medium Priority
?
421 Views
Last Modified: 2013-12-26
My C++ program needs to determine the name of a running process from its pid, without parsing the output from ps.  How is this done?
0
Comment
Question by:tmetzger
1 Comment
 

Accepted Solution

by:
mtr earned 100 total points
ID: 1292379
You didn't say what platform... some are different.  On some
(like AIX) you can use the getproc system call, which returns
a struct procinfo.  The progname is in the ui_comm field.
One of the GNU packages has a ps program in it -- you could
grab that and use it -- it probably has an example for whatever
platform you are on.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question