Re: [HACKERS] New patches for running PostgreSQL on Windows

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: horak(at)mmp(dot)plzen-city(dot)cz (Horak Daniel)
Cc: JKraaijeveld(at)askesis(dot)nl, setera(at)us(dot)ibm(dot)com, kevlo(at)hello(dot)com(dot)tw, fk(at)akf(dot)dk, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] New patches for running PostgreSQL on Windows
Date: 1999-01-17 06:16:58
Message-ID: 199901170616.BAA10380@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[Charset iso-8859-2 unsupported, filtering to ASCII...]
> Hi,
>
> I have created a new patch for compiling PostgreSQL on Windows.
>
> It requires:
> - Cygwin B20.1
> - a crypt library
> - the cygipc package
> - added the included headers (endian.h into Cygwin's include/, tcp.h into
> include/netinet and un.h into include/sys)
>
> New features:
> - it creates only postgres.exe (a hybrid between .EXE and .DLL) - it is
> similar to executables on Unix created with gcc -export-dynamic
> - it should be possible to run it on non-binary mounts (thanks to Craig
> Setera)
>
> Bugs:
> - dynamic loading still doesn't work (but it is possible to create the
> modules, e.g. plpgsql.dll)
> - sometimes the backend survives only one connection from a client, it
> crashes before the second connection is established. I have had not time to
> investigate this yet.
>
> The binaries are also available, but they are a bit huge (~3 MB in *.tgz)
> because it is compiled with debug info.
>
> I think it should be possible to begin incorporating the patches to the main
> sources. Some of the changes are new files. And the rest is ifdef-ed (or
> ifeq-ed in Makefiles), so it should not interfere with other ports, I hope
> :-)
>
> Dan
>
>

I think it is good to merge this into the tree. Tracking our tree
yourself is very difficult.

Applied. The only problem is that this part of the patch did not apply
because the function has changed. In fact, there is no call fdopen()
left in the entire code tree.

Developers, be warned that all open()'s need a win32 test for 'binary'
opening, and Makefiles not need a $(X) optional extension added.

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

***************
*** 88,93 ****
void
pq_init(int fd)
{
Pfin = fdopen(fd, "r");
Pfout = fdopen(dup(fd), "w");
if (!Pfin || !Pfout)
--- 88,102 ----
void
pq_init(int fd)
{
+ #ifdef __CYGWIN32__
+ /* the fd file handle isn't readable :)
+ it can probably be an error in Cygwin B19.3 */
+ int flags, res;
+
+ flags = O_RDWR;
+ res = fcntl(fd, F_SETFL, flags);
+ #endif
+
Pfin = fdopen(fd, "r");
Pfout = fdopen(dup(fd), "w");
if (!Pfin || !Pfout)

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-01-17 06:26:52 Re: [HACKERS] New patches for running PostgreSQL on Windows
Previous Message Bruce Momjian 1999-01-17 03:40:55 Re: [HACKERS] CURRENT: crash in select_view regression test...