🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.internals
Article #2386

Re: PS info from C?

#2386
From: Ed Carp
Date: Fri, 20 Nov 1992 00:13
26 lines
1603 bytes
Durrant;f110or89;[05306 (jmd6@unix.brighton.ac.uk) wrote:

: I using sunos 4.1.2.3 and I'm after getting access to
: the process information for a running process. By info
: I mean processor time used, command running, mem in use, etc.
: The sort of thing that ps returns. I think it should be 
: possible through ptrace but this only terminates the process
: I attach to.

There is a set of calls (kvm_*) that SunOS uses to do this; they're quite easy
to use.  You have to use "-lkvm" to link with, though.  If you want me to,
I'll be happy to email you some sample source...

Do a "man kvm_open" on SunOS - I think it'll tell you all you need to know.
--
Ed Carp			erc@apple.com, erc@saturn.upl.com	801/538-0177

"There is nothing to seek and nothing to find.  You're already enlightened, and
all the words in the world won't give you what you already have.  The wise
seeker, therefore, is concerned with one thing only: to become aware of what
he already is, of the True Self within."  -- Zen maxim
-- 
Ed Carp			erc@apple.com, erc@saturn.upl.com	801/538-0177

"There is nothing to seek and nothing to find.  You're already enlightened, and
all the words in the world won't give you what you already have.  The wise
Technical Details
Message-ID: <1992Nov20.001347.8254@unislc.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!unislc!erc
References: <1992Nov13.114227.2506@unix.brighton.ac.uk>

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.internals
Path: arc1-ca.pugleaf.net!sparky!uunet!unislc!erc
From: erc@unislc.uucp (Ed Carp)
Subject: Re: PS info from C?
X-Newsreader: TIN [version 1.1 PL6]
References: <1992Nov13.114227.2506@unix.brighton.ac.uk>
Message-ID: <1992Nov20.001347.8254@unislc.uucp>
Organization: Unisys Corporation SLC
Date: Fri, 20 Nov 1992 00:13:47 GMT
Lines: 26