Re: FW: [CYGWIN] 7.2b3 postmaster doesn't start on Win98 - Mailing list pgsql-hackers

From mlw
Subject Re: FW: [CYGWIN] 7.2b3 postmaster doesn't start on Win98
Date
Msg-id 3C0C4C0A.C8003248@mohawksoft.com
Whole thread Raw
In response to Re: FW: [CYGWIN] 7.2b3 postmaster doesn't start on Win98  (Horák Daniel <horak@sit.plzen-city.cz>)
List pgsql-hackers
Tom Lane wrote:
> 
> mlw <markw@mohawksoft.com> writes:
> > I'll write and test something with cygwin this week if that would help. (If
> > someone can get to it first it is something stupid like "GetWindowsVersion()"
> > or something like that.
> 
> Well, the non-stupid part is to know which return values correspond to
> Windows versions that have proper file permissions and which values to
> versions that don't.  Given that NT and the other versions are two
> separate code streams (no?), I'm not sure that distinguishing this is
> trivial, and even less sure that we should assume all future Windows
> releases will have it.  I'd be more comfortable with an autoconf-like
> approach: actually probe the desired feature and see if it works.
> 
> I was thinking this morning about trying to chmod the directory and,
> if that doesn't report an error, assuming that all is well.  On Windows
> it'd presumably claim success despite not being able to do what is asked
> for.  But this would definitely require testing.
> 
> I'm really not happy about the idea of holding up the release for this...

It is a trivial peice of code to write, there is a bit mask that indicates the
technology. Be it DOS or NT. I will be able to get to it over the week.

The proper test would be to test for "known" DOS legacy because all future
Windows versions will be at least capable of file permissions.

The function call is GetVersionEx(...) it accepts a structure:

Platform SDK: Windows System Information

 OSVERSIONINFO
 The OSVERSIONINFO data structure contains operating system version
information. The information includes major and minor version numbers, a build number, a platform identifier, and
descriptivetext about the operating system. This
 
structure is used with the GetVersionEx function.
 typedef struct _OSVERSIONINFO{    DWORD dwOSVersionInfoSize;    DWORD dwMajorVersion;    DWORD dwMinorVersion;
DWORDdwBuildNumber;    DWORD dwPlatformId;    TCHAR szCSDVersion[ 128 ];  } OSVERSIONINFO; 
 
 Members
 dwOSVersionInfoSize      Specifies the size, in bytes, of this data structure. Set this member to
sizeof(OSVERSIONINFO)before calling the GetVersionEx function.  dwMajorVersion      Identifies the major version number
ofthe operating system as follows.      Operating System                       Value     Windows 95
 4     Windows 98                       4     Windows Me                       4     Windows NT 3.51
  3     Windows NT 4.0                       4     Windows 2000                       5     Windows XP
    5     Windows .NET Server                       5
 

 dwMinorVersion      Identifies the minor version number of the operating system as follows.      Operating System
                Value     Windows 95                       0     Windows 98                       10     Windows Me
                 90     Windows NT 3.51                       51     Windows NT 4.0                       0     Windows
2000                      0     Windows XP                       1     Windows .NET Server                       1
 

 dwBuildNumber      Windows NT/2000/XP: Identifies the build number of the operating system. 
     Windows 95/98/Me: Identifies the build number of the operating system in
the     low-order word. The high-order word contains the major and minor version     numbers.  dwPlatformId
Identifiesthe operating system platform. This member can be one of the     following values.      Value
                             Platform     VER_PLATFORM_WIN32s                                               Win32s on
Windows3.1.      VER_PLATFORM_WIN32_WINDOWS                                               Windows 95, Windows 98, or
                                          Windows Me.      VER_PLATFORM_WIN32_NT
      Windows NT 3.51,                                               Windows NT 4.0,
          Windows 2000, Windows XP,                                               or Windows .NET Server.
 

 szCSDVersion      Windows NT/2000/XP: Contains a null-terminated string, such as "Service     Pack 3", that indicates
thelatest Service Pack installed on the system.
 
If no Service     Pack has been installed, the string is empty. 
     Windows 95/98/Me: Contains a null-terminated string that indicates
additional     version information. For example, " C" indicates Windows 95 OSR2 and " A"     indicates Windows 98
SecondEdition.
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance problem with large insert statements
Next
From: Barry Lind
Date:
Subject: Re: Performance problem with large insert statements