Date: Thu, 13 May 1999 15:55:04 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Richard Dawe cc: djgpp-workers AT delorie DOT com Subject: Re: $HOSTNAME doesn't override library code In-Reply-To: <3738C473.D2105F0D@meridian22.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 12 May 1999, Richard Dawe wrote: > I've just been looking at the source file > src/libc/compat/unistd/gethostn.c and I noticed that you cannot override > the string returned by gethostname() by setting $HOSTNAME. Would it not be > better to let the user override it? The value of $HOSTNAME is a fallback, not an override. The code calls the network-aware function which returns whatever name you system has been configured to. This is what a Unix machine would do as well. > This behaviour seems to contradict the approach taken with $USER. There's no contradiction: $USER overrides the default "dosuser" exactly as $HOSTNAME overrides the default "pc". The difference is that in the case of gethostname there is a DOS function that returns the actual name of a machine, whereas there's no DOS function that returns the name of the user. So the call to Int 21h/AH=5Eh is *in addition* to the environment override.