FAQ
I broke the Win32 build members by using access(X_OK) in pg_upgrade. I
have a fix for this but looking at pg_upgrade's exec.c, I see for
Win32:

if ((buf.st_mode & S_IXUSR) == 0)

I am confused why Windows supports S_IXUSR but not X_OK.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Search Discussions

  • Magnus Hagander at May 18, 2011 at 4:12 pm

    On Wed, May 18, 2011 at 11:41, Bruce Momjian wrote:
    I broke the Win32 build members by using access(X_OK) in pg_upgrade.  I
    have a fix for this but looking at pg_upgrade's exec.c, I see for
    Win32:

    if ((buf.st_mode & S_IXUSR) == 0)

    I am confused why Windows supports S_IXUSR but not X_OK.
    It doesn't natively - we define it in port/win32.h
  • Bruce Momjian at May 18, 2011 at 4:16 pm

    Magnus Hagander wrote:
    On Wed, May 18, 2011 at 11:41, Bruce Momjian wrote:
    I broke the Win32 build members by using access(X_OK) in pg_upgrade. ?I
    have a fix for this but looking at pg_upgrade's exec.c, I see for
    Win32:

    ? ? ? ? ? ?if ((buf.st_mode & S_IXUSR) == 0)

    I am confused why Windows supports S_IXUSR but not X_OK.
    It doesn't natively - we define it in port/win32.h
    Sure, but that is defined as _S_IEXEC:

    #define S_IXUSR _S_IEXEC
    #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)

    So what is _S_IEXEC. Anyway, execute permission means something
    different on Win32 for directories so I have a fix applied.

    --
    Bruce Momjian <bruce@momjian.us> http://momjian.us
    EnterpriseDB http://enterprisedb.com

    + It's impossible for everything to be true. +
  • Magnus Hagander at May 18, 2011 at 4:18 pm

    On Wed, May 18, 2011 at 12:16, Bruce Momjian wrote:
    Magnus Hagander wrote:
    On Wed, May 18, 2011 at 11:41, Bruce Momjian wrote:
    I broke the Win32 build members by using access(X_OK) in pg_upgrade. ?I
    have a fix for this but looking at pg_upgrade's exec.c, I see for
    Win32:

    ? ? ? ? ? ?if ((buf.st_mode & S_IXUSR) == 0)

    I am confused why Windows supports S_IXUSR but not X_OK.
    It doesn't natively - we define it in port/win32.h
    Sure, but that is defined as _S_IEXEC:

    #define S_IXUSR _S_IEXEC
    #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)

    So what is _S_IEXEC.  Anyway, execute permission means something
    different on Win32 for directories so I have a fix applied.
    I'm pretty sure it's mapped to read permissions internally in the API headers.
  • Bruce Momjian at May 18, 2011 at 4:14 pm

    Bruce Momjian wrote:
    I broke the Win32 build members by using access(X_OK) in pg_upgrade. I
    have a fix for this but looking at pg_upgrade's exec.c, I see for
    Win32:

    if ((buf.st_mode & S_IXUSR) == 0)

    I am confused why Windows supports S_IXUSR but not X_OK.
    I have applied the attached patch to fix this.

    --
    Bruce Momjian <bruce@momjian.us> http://momjian.us
    EnterpriseDB http://enterprisedb.com

    + It's impossible for everything to be true. +

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedMay 18, '11 at 3:41p
activeMay 18, '11 at 4:18p
posts5
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Bruce Momjian: 3 posts Magnus Hagander: 2 posts

People

Translate

site design / logo © 2021 Grokbase