www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/29/02:53:49

Date: Sun, 29 Dec 1996 09:41:36 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Murray Stokely <murray AT southeast DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Detecting Operating System
In-Reply-To: <32c5ebb1.336016122@nntp.southeast.net>
Message-ID: <Pine.SUN.3.91.961229093828.10388T-100000@is>
MIME-Version: 1.0

On Sun, 29 Dec 1996, Murray Stokely wrote:

>      Can anyone tell me the best way to detect the host Operating
> System in DJGPP?  I know about _go32_info_block.run_mode but it
> doesn't seem to be able to give me the exact information I need.  I'd
> like to be able to detect Windows 95/NT, OS/2 and Linux/DosEmu.

The easiest way is to call `_get_dos_version' library function with a 
non-zero argument.  DOS returns numbers upto 6.22, Windows 95 returns 7.0, 
Windows/NT returns 5.50, and I guess OS/2 and Linux return something that 
cannot be mistaken for DOS.  If you need to distinguish between DOS 7 
under Windows 95 and pure DOS 7, call one of the functions which support 
long filenames and see if they fail.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019