Mail Archives: djgpp/1996/12/29/02:53:49
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 -