[comp.unix.aix] Need information on getprocinfo

jfh@rpp386.cactus.org (John F Haugh II) (03/29/91)

In article <1991Mar29.063253.2770@rice.edu> berk@blenda.rice.edu (Murat Berk) writes:
>I try to get information on a process which pid is known.
>The only referance I can find is the procinfo structure in the
>/usr/include/procinfo.h file.
>
>>/*
>> * An array of these structures is returned by getprocs()
>> */
>>struct  procinfo
>>{
>....
>
>But I cannot find any information for getprocs in info. Both find and search
>for getprocs fails. Another reference is in the /usr/include/sys/proc.h
>file. They recommend to read a file,
>
>> * NOTE:        See sys/proc/README for details.
>
>I could not find this file. It is not under include, not under /usr/lpp

That's because it is in the source code tree.

>The only thing I want to have is a pointer to the procinfo structure
>so I can get the user and sys times for a process. If there exist another
>way or routine, where should I look for info. Please E-mail me.

You should call the IBM support number that you have.  They have been
asked this question a thousand times and have exactly the information
you are requesting.  The interface was initially not documented because
it wasn't to be used by user applications.  Obviously user's think it
is useful, so they are using it ;-)

Actually, if you have the process ID you have the slot number that the
(struct proc) is in.  You can take that number and use it as an offset
into the process table and read the entire structure yourself.  Of
course that's very unportable ...

This is another question for the FAQ for this group.  Is there anybody
collecting them this week???
-- 
John F. Haugh II        | Distribution to  | UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832 | GEnie PROHIBITED :-) |  Domain: jfh@rpp386.cactus.org
"I want to be Robin to Bush's Batman."
                -- Vice President Dan Quayle

geoff@edm.uucp (Geoff Coleman) (04/05/91)

In article <19134@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes:
>In article <1991Mar29.063253.2770@rice.edu> berk@blenda.rice.edu (Murat Berk) writes:
>>
>>But I cannot find any information for getprocs in info. Both find and search
>>for getprocs fails. Another reference is in the /usr/include/sys/proc.h
>>file. They recommend to read a file,
>>
>
>That's because it is in the source code tree.
>
>You should call the IBM support number that you have.  They have been
>asked this question a thousand times and have exactly the information
>you are requesting.  The interface was initially not documented because
>it wasn't to be used by user applications.  Obviously user's think it
>is useful, so they are using it ;-)

	Yes but will it be around for long. After a lot of begging , 
pleading I got a copy of the man page for this faxed to me. But the person
who faxed it to me made very clear that 1) the call is not supported (ie. 
use at your own risk) and 2) the call may not survive long in AIX 3.1.?????


Geoff Coleman

>
>Actually, if you have the process ID you have the slot number that the
>(struct proc) is in.  You can take that number and use it as an offset
>into the process table and read the entire structure yourself.  Of
>course that's very unportable ...
>
>This is another question for the FAQ for this group.  Is there anybody
>collecting them this week???
>-- 
>John F. Haugh II        | Distribution to  | UUCP: ...!cs.utexas.edu!rpp386!jfh
>Ma Bell: (512) 832-8832 | GEnie PROHIBITED :-) |  Domain: jfh@rpp386.cactus.org
>"I want to be Robin to Bush's Batman."
>                -- Vice President Dan Quayle

jfh@greenber.austin.ibm.com (John F Haugh II) (04/06/91)

In article <1991Apr05.041016.23870@edm.uucp> geoff@edm.uucp (Geoff Coleman) writes:
>In article <19134@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes:
>>You should call the IBM support number that you have.  They have been
>>asked this question a thousand times and have exactly the information
>>you are requesting.  The interface was initially not documented because
>>it wasn't to be used by user applications.  Obviously user's think it
>>is useful, so they are using it ;-)
>
>	Yes but will it be around for long. After a lot of begging , 
>pleading I got a copy of the man page for this faxed to me. But the person
>who faxed it to me made very clear that 1) the call is not supported (ie. 
>use at your own risk) and 2) the call may not survive long in AIX 3.1.?????

Please don't make the assumption that the system call or the system call
interface will "be around for [a] long" time.  That is exactly the reasoning
I was given when I requested permission initially to release the getprocinfo()
interface information.  The reason for keeping the interface "unsupported"
is to allow development to change the interface for whatever reasons they
may come up with.

Without giving examples, it is possible that a more/better/different
interface may be dreamt up at some point in the future, and having it be a
"supported" interface would prevent any non-compatible changes from being
made.

So, use it at your own risk - and let IBM know that you find the system
call useful, so they will be encouraged to begin supporting it.  This is
the kind of feedback IBM likes to hear.

DISCLAIMER: I don't speak for IBM or LCC or any other organization.
-- 
John F. Haugh II      |      I've Been Moved     |    MaBellNet: (512) 838-4340
SneakerNet: 809/1D064 |          AGAIN !         |      VNET: LCCB386 at AUSVMQ
BangNet: ..!cs.utexas.edu!ibmchs!auschs!snowball.austin.ibm.com!jfh (e-i-e-i-o)