Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Process Name from PID

Posted on 1997-03-05
1
409 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 50 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 466
Perl Awk Need Help 3 128
Looking for a specific application/software 2 114
Detect CR LF to each line 12 169
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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. …
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

790 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