From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 21 Jul 93 15:39:37 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: SunAda question Message-ID: List-Id: 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...