Re: Win32 path patch

Lists: pgsql-patches
From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Win32 path patch
Date: 2003-04-02 20:15:59
Message-ID: 200304022015.h32KFxR06550@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Here is my first patch toward the native Win32 port. It is taken from
PeerDirect/Jan's Win32 port, with reference to SRA's port.

The patch deals with file path separators '/' vs '\' (Win32 supports
both in C), and Win32 drive letter handling.

The patch is 700 lines, but adds only two WIN32's to the code. The
majority of the work is done in port/path.c. While /port was for
port-specific stuff, in this case, it seems like the best place to put
functions that are used by both the backend and interfaces/clients.

I just hope my other patches are as clean as this one. :-)

Here is a rough outline of the major Win32 item needed:

*file path separators
*root directory
handle \r in COPY
copydir for cp -r
rmdir not recursive for rm -r
rename atomicity
shared memory could map to new address in exec child
compatibility defines
spinlock changes
DWORD in help.c
initdb
fork/exec

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 21.1 KB
unknown_filename text/plain 1.7 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Win32 path patch
Date: 2003-04-03 15:07:43
Message-ID: Pine.LNX.4.44.0304031541390.2215-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian writes:

> The patch is 700 lines, but adds only two WIN32's to the code. The
> majority of the work is done in port/path.c. While /port was for
> port-specific stuff, in this case, it seems like the best place to put
> functions that are used by both the backend and interfaces/clients.

But there is no reason to write AC_LIBOBJ(path) unconditionally in
configure.in. Just handle it in the Makefile.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Win32 path patch
Date: 2003-04-04 20:13:49
Message-ID: 200304042013.h34KDnO14375@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


OK, here is a new patch. I moved the path.o inclusion into
Makefile.global. I couldn't put it in port/Makefile because
interfaces/libpq/Makefile looks at LIBOBJ too.

---------------------------------------------------------------------------

Peter Eisentraut wrote:
> Bruce Momjian writes:
>
> > The patch is 700 lines, but adds only two WIN32's to the code. The
> > majority of the work is done in port/path.c. While /port was for
> > port-specific stuff, in this case, it seems like the best place to put
> > functions that are used by both the backend and interfaces/clients.
>
> But there is no reason to write AC_LIBOBJ(path) unconditionally in
> configure.in. Just handle it in the Makefile.
>
> --
> Peter Eisentraut peter_e(at)gmx(dot)net
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 20.6 KB