comp.lang.ada
 help / color / mirror / Atom feed
* Pragma's for Ada ????
@ 1993-09-14 21:11  STREETER
  0 siblings, 0 replies; 3+ messages in thread
From:  STREETER @ 1993-09-14 21:11 UTC (permalink / raw)


HELP !!!!!

I need to do two things with Ada that I have no experience doing :

  1. I need to check the HOST-ID of both RISC-6000 and Sparc-4 machines

  2. I need to read files from a CD-ROM Drive in ISO-9660 format Level1 
     and convert them back to normal Unix files and store them in the proper
     directories.

I realize I will probably need to you Pragma Interface to do this but I
have Little to no experience doing this.  If anyone has some sample code or
algorithms to solve either one of problems the help would be greatly
appriecated.  Thanks in advance ...

Blake Streeter
Please Email Me at my Work Address -- brs@sps.com

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

* Re: Pragma's for Ada ????
@ 1993-09-15  8:31 cis.ohio-state.edu!math.ohio-state.edu!sol.ctr.columbia.edu!xlink.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!ucaa2385
  0 siblings, 0 replies; 3+ messages in thread
From: cis.ohio-state.edu!math.ohio-state.edu!sol.ctr.columbia.edu!xlink.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!ucaa2385 @ 1993-09-15  8:31 UTC (permalink / raw)


In article <CDD47G.9nq@zeno.fit.edu> ecs28926@zach.fit.edu ( STREETER) writes:

>HELP !!!!!

calm down (it's too loud ;-)

>  1. I need to check the HOST-ID of both RISC-6000 and Sparc-4 machines

                     WITH Text_IO , System ;
PROCEDURE Sysnam IS BEGIN Text_IO.put_Line
(System.Name'IMAGE(System.SYSTEM_NAME) & " selected from:");
FOR I IN System.Name LOOP
Text_IO.put(System.Name'IMAGE(I)); Text_IO.put(' ');
END LOOP;
END Sysnam; -- ph

Regards,

Peter Hermann

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

* Re: Pragma's for Ada ????
@ 1993-09-15 14:02 David Emery
  0 siblings, 0 replies; 3+ messages in thread
From: David Emery @ 1993-09-15 14:02 UTC (permalink / raw)


System.System_Name is NOT the same as host ID.  For instance,
System.System_Name on my Sparc is "sun_4_unix", and the host_id is
55433bc7.  System.System_Name is generally the 'architecture' or
computer name, while Hostid is a per-machine unique identifier (sort
of a serial number.)

On a Sun/Sparc, the following should do the trick:

	function hostid
	    return string
	is
	  type C_int is new integer;
		-- assuming Standard.integer is the same as C's int.
	  function gethostid return C_int;
	  pragma interface (C, gethostid);
	
	  id : C_int;
	begin
	  id := gethostid;
	  return c_int'image(id);
	end hostid;

Here's the man page entry for gethostid from Sun/SPARC:	

	NAME
	     gethostid - get unique identifier of current host
	
	SYNOPSIS
	     gethostid()
	
	DESCRIPTION
	     gethostid() returns the 32-bit identifier  for  the  current
	     host,  which  should  be  unique across all hosts.  On a Sun
	     workstation, this number is taken from the  CPU  board's  ID
	     PROM.
	
	SEE ALSO
	     hostid(1)

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

end of thread, other threads:[~1993-09-15 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-09-14 21:11 Pragma's for Ada ????  STREETER
  -- strict thread matches above, loose matches on Subject: below --
1993-09-15  8:31 cis.ohio-state.edu!math.ohio-state.edu!sol.ctr.columbia.edu!xlink.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!ucaa2385
1993-09-15 14:02 David Emery

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