Solved

Process Name from PID

Posted on 1997-03-05
1
396 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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now