head	1.12;
access;
symbols
	REL9_0_0:1.12
	REL9_1_ALPHA1:1.12
	REL9_0_RC1:1.12
	REL9_0_BETA4:1.12
	REL9_0_STABLE:1.12.0.14
	REL9_0_BETA3:1.12
	REL9_0_BETA2:1.12
	REL7_4_29:1.1
	REL8_0_25:1.6
	REL8_1_21:1.6
	REL8_2_17:1.8
	REL8_3_11:1.11
	REL8_4_4:1.12
	REL9_0_BETA1:1.12
	REL9_0_ALPHA5_BRANCH:1.12.0.12
	REL9_0_ALPHA5:1.12
	REL7_4_28:1.1
	REL8_0_24:1.6
	REL8_1_20:1.6
	REL8_2_16:1.8
	REL8_3_10:1.11
	REL8_4_3:1.12
	REL9_0_ALPHA4:1.12
	REL9_0_ALPHA4_BRANCH:1.12.0.10
	REL8_5_ALPHA3:1.12
	REL8_5_ALPHA3_BRANCH:1.12.0.8
	REL7_4_27:1.1
	REL8_0_23:1.6
	REL8_1_19:1.6
	REL8_2_15:1.8
	REL8_3_9:1.11
	REL8_4_2:1.12
	REL8_5_ALPHA2:1.12
	REL8_5_ALPHA2_BRANCH:1.12.0.6
	REL7_4_26:1.1
	REL8_0_22:1.6
	REL8_1_18:1.6
	REL8_2_14:1.8
	REL8_3_8:1.11
	REL8_4_1:1.12
	REL8_5_ALPHA1:1.12
	REL8_5_ALPHA1_BRANCH:1.12.0.4
	REL8_4_STABLE:1.12.0.2
	REL8_4_0:1.12
	REL8_4_RC2:1.12
	REL8_4_RC1:1.12
	REL8_4_BETA2:1.12
	REL8_4_BETA1:1.12
	REL7_4_25:1.1
	REL8_0_21:1.6
	REL8_1_17:1.6
	REL8_2_13:1.8
	REL8_3_7:1.11
	REL7_4_24:1.1
	REL8_0_20:1.6
	REL8_1_16:1.6
	REL8_2_12:1.8
	REL8_3_6:1.11
	REL7_4_23:1.1
	REL8_0_19:1.6
	REL8_1_15:1.6
	REL8_2_11:1.8
	REL8_3_5:1.11
	REL7_4_22:1.1
	REL8_0_18:1.6
	REL8_1_14:1.6
	REL8_2_10:1.8
	REL8_3_4:1.11
	REL7_4_21:1.1
	REL8_0_17:1.6
	REL8_1_13:1.6
	REL8_2_9:1.8
	REL8_3_3:1.11
	REL7_4_20:1.1
	REL8_0_16:1.6
	REL8_1_12:1.6
	REL8_2_8:1.8
	REL8_3_2:1.11
	REL8_2_7:1.8
	REL8_3_1:1.11
	REL8_3_STABLE:1.11.0.2
	REL8_3_0:1.11
	REL8_3_RC2:1.11
	REL7_4_19:1.1
	REL8_0_15:1.6
	REL8_1_11:1.6
	REL8_2_6:1.8
	REL8_3_RC1:1.11
	REL8_3_BETA4:1.11
	REL8_3_BETA3:1.11
	REL8_3_BETA2:1.10
	REL8_3_BETA1:1.10
	REL7_4_18:1.1
	REL8_0_14:1.6
	REL8_1_10:1.6
	REL8_2_5:1.8
	REL7_4_17:1.1
	REL8_0_13:1.6
	REL8_1_9:1.6
	REL8_2_4:1.8
	REL8_0_12:1.6
	REL8_1_8:1.6
	REL8_2_3:1.8
	REL7_4_16:1.1
	REL8_0_11:1.6
	REL8_1_7:1.6
	REL8_2_2:1.8
	REL8_0_10:1.6
	REL8_1_6:1.6
	REL8_2_1:1.8
	REL7_4_15:1.1
	REL8_2_STABLE:1.8.0.2
	REL8_2_0:1.8
	REL8_2_RC1:1.8
	REL8_2_BETA3:1.8
	REL8_2_BETA2:1.8
	REL8_1_5:1.6
	REL8_0_9:1.6
	REL7_4_14:1.1
	REL8_2_BETA1:1.8
	REL7_4_13:1.1
	REL8_0_8:1.6
	REL8_1_4:1.6
	REL7_4_12:1.1
	REL8_0_7:1.6
	REL8_1_3:1.6
	REL7_4_11:1.1
	REL8_0_6:1.6
	REL8_1_2:1.6
	REL7_4_10:1.1
	REL8_0_5:1.6
	REL8_1_1:1.6
	REL8_1_STABLE:1.6.0.6
	REL8_1_0:1.6
	REL8_1_0RC1:1.6
	REL8_1_0BETA4:1.6
	REL8_1_0BETA3:1.6
	REL7_4_9:1.1
	REL8_0_4:1.6
	REL8_1_0BETA2:1.6
	REL8_1_0BETA1:1.6
	REL7_4_8:1.1
	REL8_0_3:1.6
	REL8_0_2:1.6
	REL7_4_7:1.1
	REL8_0_1:1.6
	REL8_0_STABLE:1.6.0.4
	REL8_0_0:1.6.0.2
	REL8_0_0RC5:1.6
	REL8_0_0RC4:1.6
	REL8_0_0RC3:1.6
	REL8_0_0RC2:1.6
	REL8_0_0RC1:1.6
	REL8_0_0BETA5:1.6
	REL8_0_0BETA4:1.6
	REL7_4_6:1.1
	REL8_0_0BETA3:1.6
	REL8_0_0BETA2:1.6
	REL7_4_5:1.1
	REL7_4_4:1.1
	REL8_0_0BETA1:1.5
	REL7_4_3:1.1
	REL7_4_2:1.1
	REL7_4_1:1.1
	REL7_4:1.1
	REL7_4_RC2:1.1
	REL7_4_STABLE:1.1.0.4
	REL7_4_RC1:1.1
	REL7_4_BETA5:1.1
	REL7_4_BETA4:1.1
	REL7_4_BETA3:1.1
	REL7_4_BETA2:1.1
	WIN32_DEV:1.1.0.2
	REL7_4_BETA1:1.1;
locks; strict;
comment	@# @;


1.12
date	2008.02.19.15.29.58;	author petere;	state Exp;
branches;
next	1.11;

1.11
date	2007.10.29.12.35.41;	author mha;	state Exp;
branches;
next	1.10;

1.10
date	2007.03.21.14.39.23;	author mha;	state Exp;
branches;
next	1.9;

1.9
date	2007.01.20.17.16.12;	author petere;	state Exp;
branches;
next	1.8;

1.8
date	2006.06.07.22.24.43;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	2006.04.29.20.52.56;	author tgl;	state Exp;
branches;
next	1.6;

1.6
date	2004.08.29.00.38.03;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	2004.06.24.21.02.42;	author tgl;	state Exp;
branches;
next	1.4;

1.4
date	2004.04.12.16.19.18;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	2004.02.18.16.25.12;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	2003.11.29.19.51.54;	author pgsql;	state Exp;
branches;
next	1.1;

1.1
date	2003.04.24.21.25.34;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.12
log
@More refactoring, so that the SUBSYS.o rules are now all in one place.
@
text
@#-------------------------------------------------------------------------
#
# Makefile--
#    Makefile for backend/port/win32
#
# IDENTIFICATION
#    $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.11 2007/10/29 12:35:41 mha Exp $
#
#-------------------------------------------------------------------------

subdir = src/backend/port/win32
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global

OBJS = timer.o socket.o signal.o security.o mingwcompat.o

include $(top_srcdir)/src/backend/common.mk
@


1.11
log
@Add compat file for dynamically loading the functions that MinGW is missing
the imports for. Add RegisterWaitForSingleObject() to the list of such
functions, which should take care of the current buildfarm breakage.
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.10 2007/03/21 14:39:23 mha Exp $
d17 1
a17 7
all: SUBSYS.o

SUBSYS.o: $(OBJS)
	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)

clean: 
	rm -f SUBSYS.o $(OBJS)
@


1.10
log
@Native shared memory implementation for win32.
Uses same underlying tech as before, but not the sysv emulation layer.
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.9 2007/01/20 17:16:12 petere Exp $
d15 1
a15 1
OBJS = timer.o socket.o signal.o security.o
@


1.9
log
@Remove remains of old depend target.
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.8 2006/06/07 22:24:43 momjian Exp $
d15 1
a15 1
OBJS = shmem.o timer.o socket.o signal.o security.o
@


1.8
log
@Prepare code to be built by MSVC:

	o  remove many WIN32_CLIENT_ONLY defines
	o  add WIN32_ONLY_COMPILER define
	o  add 3rd argument to open() for portability
	o  add include/port/win32_msvc directory for
	   system includes

Magnus Hagander
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.7 2006/04/29 20:52:56 tgl Exp $
a21 3
depend dep:
	$(CC) -MM $(CFLAGS) *.c >depend

a23 4

ifeq (depend,$(wildcard depend))
include depend
endif
@


1.7
log
@Remove sema.c, superseded by win32_sema.c.
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql/src/backend/port/win32/Makefile,v 1.6 2004/08/29 00:38:03 momjian Exp $
d15 1
a15 1
OBJS = shmem.o timer.o socket.o signal.o security.o error.o
@


1.6
log
@>>> I understand your disliking of non-posix stuff. OTOH,
>>GetLastError will
>>> give much more details than errno.
>>
>>How much more, really?  That mapping table gave me the impression that
>>the win32 error codes aren't all that much more detailed than errno...
>
>The mapping table is not complete. My winerror.h from the SDK
>lists 2209
>error codes, whereas errno.h lists 42...
>
>I still don't think we'll get that much more stuff. Right now,
>the Win32
>code paths that actually use the more advanced functions already write
>out the error number in case something happens. We can keep doing that
>for the other paths (ereport the error *number* when the mapping does
>not have a match). The map to errno will catch almost all cases, I
>think. And in the corner cases we can do with just the number, and use
>"net helpmsg" to get the actual message when checking...

Here's an attempt on this. new file goes in backend/port/win32.

Magnus Hagander
@
text
@d4 1
a4 1
#    Makefile for port/win32
d7 1
a7 1
#    $PostgreSQL: pgsql-server/src/backend/port/win32/Makefile,v 1.5 2004/06/24 21:02:42 tgl Exp $
d15 1
a15 1
OBJS = sema.o shmem.o timer.o socket.o signal.o security.o error.o
@


1.5
log
@Replace direct fprintf(stderr) calls by write_stderr(), and cause this
routine to do something appropriate on Win32.  Also, add a security check
on Win32 that parallels the can't-run-as-root check on Unix.

Magnus Hagander
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql-server/src/backend/port/win32/Makefile,v 1.4 2004/04/12 16:19:18 momjian Exp $
d15 1
a15 1
OBJS = sema.o shmem.o timer.o socket.o signal.o security.o
@


1.4
log
@Here's an attempt at new socket and signal code for win32.

It works on the principle of turning sockets into non-blocking, and then
emulate blocking behaviour on top of that, while allowing signals to
run. Signals are now implemented using an event instead of APCs, thus
getting rid of the issue of APCs not being compatible with "old style"
sockets functions.

It also moves the win32 specific code away from pqsignal.h/c into
port/win32, and also removes the "thread style workaround" of the APC
issue previously in place.

In order to make things work, a few things are also changed in pgstat.c:

1) There is now a separate pipe to the collector and the bufferer. This
is required because the pipe will otherwise only be signalled in one of
the processes when the postmaster goes down. The MS winsock code for
select() must have some kind of workaround for this behaviour, but I
have found no stable way of doing that. You really are not supposed to
use the same socket from more than one process (unless you use
WSADuplicateSocket(), in which case the docs specifically say that only
one will be flagged).

2) The check for "postmaster death" is moved into a separate select()
call after the main loop. The previous behaviour select():ed on the
postmaster pipe, while later explicitly saying "we do NOT check for
postmaster exit inside the loop".
The issue was that the code relies on the same select() call seeing both
the postmaster pipe *and* the pgstat pipe go away. This does not always
happen, and it appears that useing WSAEventSelect() makes it even more
common that it does not.
Since it's only called when the process exits, I don't think using a
separate select() call will have any significant impact on how the stats
collector works.

Magnus Hagander
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql-server/src/backend/port/win32/Makefile,v 1.3 2004/02/18 16:25:12 momjian Exp $
d15 1
a15 1
OBJS = sema.o shmem.o timer.o socket.o signal.o
@


1.3
log
@Here is a patch that implements setitimer() on win32. With this patch
applied, deadlock detection and statement_timeout now works.

The file timer.c goes into src/backend/port/win32/.

The patch also removes two lines of "printf debugging" accidentally left
in pqsignal.h, in the console control handler.

Magnus Hagander
@
text
@d7 1
a7 1
#    $PostgreSQL: pgsql-server/src/backend/port/win32/Makefile,v 1.2 2003/11/29 19:51:54 pgsql Exp $
d15 1
a15 1
OBJS = sema.o shmem.o timer.o
@


1.2
log
@
$Header: -> $PostgreSQL Changes ...
@
text
@d7 1
a7 1
#    $PostgreSQL: /cvsroot/pgsql-server/src/backend/port/win32/Makefile,v 1.1 2003/04/24 21:25:34 momjian Exp $
d15 1
a15 1
OBJS = sema.o shmem.o
@


1.1
log
@Add Win32 Makefile for IPC stuff.
@
text
@d7 1
a7 1
#    $Header: /cvsroot/pgsql-server/src/backend/port/qnx4/Makefile,v 1.3 2000/08/31 16:10:19 petere Exp $
@

