comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@mitre-bedford.arpa  (Robert I. Eachus)
Subject: Re: SunAda question
Date: 21 Jul 93 15:39:37 GMT	[thread overview]
Message-ID: <EACHUS.93Jul21103937@spectre.mitre.org> (raw)

In article <9307201338.aa20178@Paris.ics.uci.edu> kanderso@mabillon.ICS.UCI.EDU
 (Kenneth Anderson) writes:
     ...
 >    function gethostname(name: address; namelen: integer)
		   return status_code;

 >  As defined this function seems very useless...

 >  1. Anyone know why such a useless function would be included in
 >  this package?

   To get the host name?

 >  2. What is a good portable way of finding out the name of the machine
 >  your program is running on?

     You could try calling gethostname with name containing the
address of the first byte of a string, and namelen its length.  On
return look for a null byte to indicate the end of the hostname...

     Of course you might want to write a more Ada like wrapper for
this call if you plan to use it often.

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...

             reply	other threads:[~1993-07-21 15:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-07-21 15:39 Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-07-22 10:49 SunAda question Steven Hovater
1993-07-21 20:52 Esther Lumsdon
1993-07-21 18:50 David Emery
1993-07-21 16:07 cis.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!darwin.s
1993-07-21 13:25 cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!news.cac.ps
1993-07-21 12:07 Chris Elliott
1993-07-21 11:37 Steven Hovater
1993-07-20 20:38 Kenneth Anderson
replies disabled

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