case $host_os in mingw*)
LIBOBJS="$LIBOBJS copydir.$ac_objext"
LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
+LIBOBJS="$LIBOBJS kill.$ac_objext"
LIBOBJS="$LIBOBJS open.$ac_objext"
LIBOBJS="$LIBOBJS rand.$ac_objext" ;;
esac
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.358 2004/05/22 00:34:49 tgl Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.359 2004/05/27 13:08:48 momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
case $host_os in mingw*)
AC_LIBOBJ(copydir)
AC_LIBOBJ(gettimeofday)
+AC_LIBOBJ(kill)
AC_LIBOBJ(open)
AC_LIBOBJ(rand) ;;
esac
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/port/win32/signal.c,v 1.1 2004/04/12 16:19:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/port/win32/signal.c,v 1.2 2004/05/27 13:08:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
return prevfunc;
}
-/* signal sending */
-int
-pqkill(int pid, int sig)
-{
- char pipename[128];
- BYTE sigData = sig;
- BYTE sigRet = 0;
- DWORD bytes;
-
- if (sig >= PG_SIGNAL_COUNT || sig <= 0)
- {
- errno = EINVAL;
- return -1;
- }
- if (pid <= 0)
- {
- /* No support for process groups */
- errno = EINVAL;
- return -1;
- }
- wsprintf(pipename, "\\\\.\\pipe\\pgsignal_%i", pid);
- if (!CallNamedPipe(pipename, &sigData, 1, &sigRet, 1, &bytes, 1000))
- {
- if (GetLastError() == ERROR_FILE_NOT_FOUND)
- errno = ESRCH;
- else if (GetLastError() == ERROR_ACCESS_DENIED)
- errno = EPERM;
- else
- errno = EINVAL;
- return -1;
- }
- if (bytes != 1 || sigRet != sig)
- {
- errno = ESRCH;
- return -1;
- }
-
- return 0;
-}
-
/*
* All functions below execute on the signal handler thread
* and must be synchronized as such!
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.23 2004/04/22 03:51:24 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.24 2004/05/27 13:08:54 momjian Exp $ */
/* undefine and redefine after #include */
#undef mkdir
#define SIG_ERR ((pqsigfunc)-1)
#define SIG_IGN ((pqsigfunc)1)
-#ifndef FRONTEND
-#define kill(pid,sig) pqkill(pid,sig)
-extern int pqkill(int pid, int sig);
+#define kill(pid,sig) pgkill(pid,sig)
+extern int pgkill(int pid, int sig);
+#ifndef FRONTEND
#define pg_usleep(t) pgwin32_backend_usleep(t)
void pgwin32_backend_usleep(long microsec);
#endif
--- /dev/null
+/*-------------------------------------------------------------------------
+ *
+ * kill.c
+ * kill()
+ *
+ * Copyright (c) 1996-2003, PostgreSQL Global Development Group
+ *
+ * This is a replacement version of kill for Win32 which sends
+ * signals that the backend can recognize.
+ *
+ * IDENTIFICATION
+ * $PostgreSQL: pgsql/src/port/kill.c,v 1.1 2004/05/27 13:08:57 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "postgres.h"
+
+#ifdef WIN32
+/* signal sending */
+int
+pgkill(int pid, int sig)
+{
+ char pipename[128];
+ BYTE sigData = sig;
+ BYTE sigRet = 0;
+ DWORD bytes;
+
+ if (sig >= PG_SIGNAL_COUNT || sig <= 0)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ if (pid <= 0)
+ {
+ /* No support for process groups */
+ errno = EINVAL;
+ return -1;
+ }
+ wsprintf(pipename, "\\\\.\\pipe\\pgsignal_%i", pid);
+ if (!CallNamedPipe(pipename, &sigData, 1, &sigRet, 1, &bytes, 1000))
+ {
+ if (GetLastError() == ERROR_FILE_NOT_FOUND)
+ errno = ESRCH;
+ else if (GetLastError() == ERROR_ACCESS_DENIED)
+ errno = EPERM;
+ else
+ errno = EINVAL;
+ return -1;
+ }
+ if (bytes != 1 || sigRet != sig)
+ {
+ errno = ESRCH;
+ return -1;
+ }
+
+ return 0;
+}
+#endif