comp.lang.ada
 help / color / mirror / Atom feed
* DECAda/VMS - calling GETJPI
@ 1996-06-03  0:00 Alan Paterson
  1996-06-03  0:00 ` Ken Garlington
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Alan Paterson @ 1996-06-03  0:00 UTC (permalink / raw)



Here's one for the VMS gurus (I can't post it to comp.os.vms, 
'cos there's a psychopath there who throws abuse at me):

I want to examine all processes currently active. The system 
service to do this is, of course, GetJPI (either in Starlet or 
Lib). To perform wildcard process search, this procedure 
expects to receive a value of -1 for the process_id parameter. 
Unfortunately, in the "official" spec-files for these 
procedures, this parameter has the type UNSIGNED_LONGWORD. Ada, 
quite correctly, objects to this kind of thing :-)

So, what I now do is the following:

   PID  : UNSIGNED_LONGWORD;
   PID0 : INTEGER;
   for PID0 use at PID'address;
begin
   PID0 := -1;
   loop
      GetJPI(..., Process_Id => PID, ...);

This works, but I can't help but wonder if there isn't a more 
elegant way to do it. Does anyone have experience with this?
-- 
Alan Paterson
Berne, Switzerland




^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: DECAda/VMS - calling GETJPI
@ 1996-06-06  0:00 George Haddad
  1996-06-07  0:00 ` Robert Dewar
  0 siblings, 1 reply; 24+ messages in thread
From: George Haddad @ 1996-06-06  0:00 UTC (permalink / raw)



Robert Dewar wrote:
> Consider the following example: 
>     type x is mod 10;
>     subtype y is x range 0 .. 5;

   [snip]

> Actually to be strict, the constraint error is raised by the
> conversion because -1 is not in the set of values for
> modular type x (0 .. 10).

   At last!  An opportunity to nitpick one of the comp.lang.ada 
greats.  (Or embarrass myself horribly -- you be the judge.  :-))  I 
would certainly hope that the allowable range of values for type x
is 0..9.  ;-)  Otherwise, what about this:

   V1 : constant x := 0;
   V2 : constant x := 10;
   if (V1 = V2) then Text_IO.Put_Line("Zero equals Ten."); end if;
-- 
I found these opinions on my doorstep, would you please give them a 
good home?




^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~1996-06-11  0:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-03  0:00 DECAda/VMS - calling GETJPI Alan Paterson
1996-06-03  0:00 ` Ken Garlington
1996-06-03  0:00 ` Mats Weber
1996-06-03  0:00 ` Stuart Palin
1996-06-03  0:00   ` Michael F Brenner
1996-06-03  0:00     ` Robert Dewar
1996-06-04  0:00       ` Ken Garlington
1996-06-06  0:00         ` Robert Dewar
1996-06-04  0:00       ` Michael F Brenner
1996-06-04  0:00         ` Robert Dewar
1996-06-04  0:00           ` Michael F Brenner
1996-06-04  0:00             ` Robert Dewar
1996-06-05  0:00               ` Wraparound on modular conversion (was: DECAda/VMS - calling GETJPI) Tucker Taft
1996-06-05  0:00                 ` Robert Dewar
1996-06-05  0:00               ` DECAda/VMS - calling GETJPI Robert A Duff
1996-06-05  0:00                 ` Robert Dewar
1996-06-05  0:00               ` Fergus Henderson
1996-06-05  0:00                 ` Robert A Duff
1996-06-04  0:00             ` Robert Dewar
1996-06-05  0:00             ` Adam Beneschan
1996-06-07  0:00               ` Norman H. Cohen
1996-06-11  0:00                 ` Adam Beneschan
  -- strict thread matches above, loose matches on Subject: below --
1996-06-06  0:00 George Haddad
1996-06-07  0:00 ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox