[comp.lang.ada] PID and CPU-time on UNIX

stefan@se6.cs.nps.navy.mil (westman stefan) (04/18/91)

How do I get access to the Process ID and elapsed CPU time on the current 
process my ADA program is running?
I am running Verdix ADA on an UNIX system.


Stefan Westman

jduarte@liege.ICS.UCI.EDU (J o s e D u a r t e) (04/18/91)

> How do I get access to the Process ID and elapsed CPU time on the current
> process my ADA program is running?
> I am running Verdix ADA on an UNIX system.


	I just took a look at our Verdix Ada library & I found that
it contains several "pragmas" which allow your application to
call C/UNIX library routines. If you look in the Ada "standard"
library directory, you'll find that the file "unix.a" contains the function
that you need to get the process id:

> function getpid return integer;

If there's a C routine that returns the elapsed CPU time, then there's
bound to be an Ada interface to it in this file. I'm also using the
Verdix Ada compiler in a UNIX environment (Sun4 SunOS).


Jose' D.

jduarte@liege.ICS.UCI.EDU (J o s e D u a r t e) (04/18/91)

To: stefan@se6.cs.nps.navy.mil
Reply-To: Jose Aleman Duarte <jduarte@liege.ICS.UCI.EDU>
X-Organization: UC Irvine Department of ICS



> How do I get access to the Process ID and elapsed CPU time on the current
> process my ADA program is running?
> I am running Verdix ADA on an UNIX system.


	I just took a look at our Verdix Ada library & I found that
it contains several "pragmas" which allow your application to
call C/UNIX library routines. If you look in the Ada "standard"
library directory, you'll find that the file "unix.a" contains the function
that you need to get the process id:

> function getpid return integer;

If there's a C routine that returns the elapsed CPU time, then there's
bound to be an Ada interface to it in this file. I'm also using the
Verdix Ada compiler in a UNIX environment (Sun4 SunOS).


Jose' D.