Date: Sun, 29 Dec 1996 09:41:36 +0200 (IST) From: Eli Zaretskii To: Murray Stokely cc: djgpp AT delorie DOT com Subject: Re: Detecting Operating System In-Reply-To: <32c5ebb1.336016122@nntp.southeast.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.