Index: src/backend/commands/async.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/async.c,v retrieving revision 1.108 diff -u -r1.108 async.c --- src/backend/commands/async.c 27 Jan 2004 00:45:26 -0000 1.108 +++ src/backend/commands/async.c 2 Feb 2004 21:25:57 -0000 @@ -83,7 +83,6 @@ #include "commands/async.h" #include "libpq/libpq.h" #include "libpq/pqformat.h" -#include "libpq/pqsignal.h" #include "miscadmin.h" #include "storage/ipc.h" #include "tcop/tcopprot.h" @@ -498,7 +497,7 @@ * for some reason. It's OK to send the signal first, because * the other guy can't read pg_listener until we unlock it. */ - if (pqkill(listenerPID, SIGUSR2) < 0) + if (kill(listenerPID, SIGUSR2) < 0) { /* * Get rid of pg_listener entry if it refers to a PID that Index: src/backend/port/sysv_sema.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/port/sysv_sema.c,v retrieving revision 1.13 diff -u -r1.13 sysv_sema.c --- src/backend/port/sysv_sema.c 27 Jan 2004 00:45:26 -0000 1.13 +++ src/backend/port/sysv_sema.c 2 Feb 2004 21:25:57 -0000 @@ -31,7 +31,6 @@ #include "miscadmin.h" #include "storage/ipc.h" #include "storage/pg_sema.h" -#include "libpq/pqsignal.h" #ifndef HAVE_UNION_SEMUN @@ -233,7 +232,7 @@ continue; /* oops, GETPID failed */ if (creatorPID != getpid()) { - if (pqkill(creatorPID, 0) == 0 || + if (kill(creatorPID, 0) == 0 || errno != ESRCH) continue; /* sema belongs to a live process */ } Index: src/backend/port/sysv_shmem.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/port/sysv_shmem.c,v retrieving revision 1.30 diff -u -r1.30 sysv_shmem.c --- src/backend/port/sysv_shmem.c 2 Feb 2004 00:11:31 -0000 1.30 +++ src/backend/port/sysv_shmem.c 2 Feb 2004 21:25:57 -0000 @@ -33,7 +33,6 @@ #include "miscadmin.h" #include "storage/ipc.h" #include "storage/pg_shmem.h" -#include "libpq/pqsignal.h" typedef key_t IpcMemoryKey; /* shared memory key passed to shmget(2) */ @@ -304,7 +303,7 @@ hdr = (PGShmemHeader *) memAddress; if (hdr->creatorPID != getpid()) { - if (pqkill(hdr->creatorPID, 0) == 0 || errno != ESRCH) + if (kill(hdr->creatorPID, 0) == 0 || errno != ESRCH) { shmdt(memAddress); continue; /* segment belongs to a live process */ Index: src/backend/port/win32/Makefile =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/port/win32/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- src/backend/port/win32/Makefile 29 Nov 2003 19:51:54 -0000 1.2 +++ src/backend/port/win32/Makefile 2 Feb 2004 21:25:57 -0000 @@ -12,7 +12,7 @@ top_builddir = ../../../.. include $(top_builddir)/src/Makefile.global -OBJS = sema.o shmem.o +OBJS = sema.o shmem.o select.o all: SUBSYS.o Index: src/backend/postmaster/postmaster.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v retrieving revision 1.364 diff -u -r1.364 postmaster.c --- src/backend/postmaster/postmaster.c 28 Jan 2004 21:02:40 -0000 1.364 +++ src/backend/postmaster/postmaster.c 2 Feb 2004 21:25:57 -0000 @@ -1566,7 +1566,7 @@ ereport(DEBUG2, (errmsg_internal("processing cancel request: sending SIGINT to process %d", backendPID))); - pqkill(bp->pid, SIGINT); + kill(bp->pid, SIGINT); } else /* Right PID, wrong key: no way, Jose */ @@ -1738,7 +1738,7 @@ * will start a new one with a possibly changed config */ if (BgWriterPID != 0) - pqkill(BgWriterPID, SIGTERM); + kill(BgWriterPID, SIGTERM); } PG_SETMASK(&UnBlockSig); @@ -1772,7 +1772,7 @@ * Wait for children to end their work and ShutdownDataBase. */ if (BgWriterPID != 0) - pqkill(BgWriterPID, SIGTERM); + kill(BgWriterPID, SIGTERM); if (Shutdown >= SmartShutdown) break; Shutdown = SmartShutdown; @@ -1806,7 +1806,7 @@ * and exit) and ShutdownDataBase when they are gone. */ if (BgWriterPID != 0) - pqkill(BgWriterPID, SIGTERM); + kill(BgWriterPID, SIGTERM); if (Shutdown >= FastShutdown) break; ereport(LOG, @@ -1854,13 +1854,13 @@ * properly shutdown data base system. */ if (BgWriterPID != 0) - pqkill(BgWriterPID, SIGQUIT); + kill(BgWriterPID, SIGQUIT); ereport(LOG, (errmsg("received immediate shutdown request"))); if (ShutdownPID > 0) - pqkill(ShutdownPID, SIGQUIT); + kill(ShutdownPID, SIGQUIT); if (StartupPID > 0) - pqkill(StartupPID, SIGQUIT); + kill(StartupPID, SIGQUIT); if (DLGetHead(BackendList)) SignalChildren(SIGQUIT); ExitPostmaster(0); @@ -2130,7 +2130,7 @@ (errmsg_internal("sending %s to process %d", (SendStop ? "SIGSTOP" : "SIGQUIT"), (int) bp->pid))); - pqkill(bp->pid, (SendStop ? SIGSTOP : SIGQUIT)); + kill(bp->pid, (SendStop ? SIGSTOP : SIGQUIT)); } } else @@ -2225,7 +2225,7 @@ (errmsg_internal("sending signal %d to process %d", signal, (int) bp->pid))); - pqkill(bp->pid, signal); + kill(bp->pid, signal); } curr = next; Index: src/backend/storage/ipc/pmsignal.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/ipc/pmsignal.c,v retrieving revision 1.12 diff -u -r1.12 pmsignal.c --- src/backend/storage/ipc/pmsignal.c 27 Jan 2004 00:45:26 -0000 1.12 +++ src/backend/storage/ipc/pmsignal.c 2 Feb 2004 21:25:57 -0000 @@ -20,7 +20,6 @@ #include "miscadmin.h" #include "storage/pmsignal.h" #include "storage/shmem.h" -#include "libpq/pqsignal.h" /* @@ -65,7 +64,7 @@ /* Atomically set the proper flag */ PMSignalFlags[reason] = true; /* Send signal to postmaster */ - pqkill(PostmasterPid, SIGUSR1); + kill(PostmasterPid, SIGUSR1); } /* Index: src/backend/storage/lmgr/proc.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/lmgr/proc.c,v retrieving revision 1.145 diff -u -r1.145 proc.c --- src/backend/storage/lmgr/proc.c 27 Jan 2004 00:45:26 -0000 1.145 +++ src/backend/storage/lmgr/proc.c 2 Feb 2004 21:25:57 -0000 @@ -51,7 +51,6 @@ #include "storage/proc.h" #include "storage/sinval.h" #include "storage/spin.h" -#include "libpq/pqsignal.h" /* GUC variables */ int DeadlockTimeout = 1000; @@ -1131,7 +1130,7 @@ { /* Time to die */ statement_timeout_active = false; - pqkill(MyProcPid, SIGINT); + kill(MyProcPid, SIGINT); } else { Index: src/backend/utils/init/miscinit.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/init/miscinit.c,v retrieving revision 1.121 diff -u -r1.121 miscinit.c --- src/backend/utils/init/miscinit.c 27 Jan 2004 00:45:26 -0000 1.121 +++ src/backend/utils/init/miscinit.c 2 Feb 2004 21:25:57 -0000 @@ -32,7 +32,6 @@ #include "catalog/catname.h" #include "catalog/pg_shadow.h" #include "libpq/libpq-be.h" -#include "libpq/pqsignal.h" #include "miscadmin.h" #include "storage/ipc.h" #include "storage/pg_shmem.h" @@ -532,7 +531,7 @@ */ if (other_pid != my_pid) { - if (pqkill(other_pid, 0) == 0 || + if (kill(other_pid, 0) == 0 || (errno != ESRCH #ifdef __BEOS__ && errno != EINVAL Index: src/include/libpq/pqsignal.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/libpq/pqsignal.h,v retrieving revision 1.24 diff -u -r1.24 pqsignal.h --- src/include/libpq/pqsignal.h 27 Jan 2004 00:45:26 -0000 1.24 +++ src/include/libpq/pqsignal.h 2 Feb 2004 21:25:58 -0000 @@ -22,15 +22,6 @@ #include #endif -#ifndef WIN32 -#define pqkill(pid,sig) kill(pid,sig) -#define pqsigsetmask(mask) sigsetmask(mask) -#else -int pqkill(int pid, int sig); -int pqsigsetmask(int mask); -#endif - - #ifdef HAVE_SIGPROCMASK extern sigset_t UnBlockSig, BlockSig, @@ -42,7 +33,12 @@ BlockSig, AuthBlockSig; -#define PG_SETMASK(mask) pqsigsetmask(*((int*)(mask))) +#ifndef WIN32 +#define PG_SETMASK(mask) sigsetmask(*((int*)(mask))) +#else +#define PG_SETMASK(mask) pqsigsetmask(*((int*)(mask))) +int pqsigsetmask(int mask); +#endif #endif typedef void (*pqsigfunc) (int); Index: src/include/port/win32.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/port/win32.h,v retrieving revision 1.16 diff -u -r1.16 win32.h --- src/include/port/win32.h 26 Jan 2004 22:59:54 -0000 1.16 +++ src/include/port/win32.h 2 Feb 2004 21:25:58 -0000 @@ -100,6 +100,15 @@ #define sleep(sec) (Sleep(sec * 1000), /* no return value */ 0) + +/* In libpq/pqsignal.c */ +#define kill(pid,sig) pqkill(pid,sig) +int pqkill(int pid, int sig); + +/* In backend/port/win32/select.c */ +#define select(a,b,c,d,e) pqselect(a,b,c,d,e) +int pqselect(int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t); + /* Some extra signals */ #define SIGHUP 1 #define SIGQUIT 3