1 /*-------------------------------------------------------------------------
6 * Copyright (c) 1996-2010, PostgreSQL Global Development Group
8 * This is a replacement version of kill for Win32 which sends
9 * signals that the backend can recognize.
12 * $PostgreSQL: pgsql/src/port/kill.c,v 1.14 2010/01/31 17:18:28 mha Exp $
14 *-------------------------------------------------------------------------
22 pgkill(int pid, int sig)
29 /* we allow signal 0 here, but it will be ignored in pg_queue_signal */
30 if (sig >= PG_SIGNAL_COUNT || sig < 0)
37 /* No support for process groups */
41 snprintf(pipename, sizeof(pipename), "\\\\.\\pipe\\pgsignal_%u", pid);
43 if (CallNamedPipe(pipename, &sigData, 1, &sigRet, 1, &bytes, 1000))
45 if (bytes != 1 || sigRet != sig)
53 if (GetLastError() == ERROR_FILE_NOT_FOUND)
55 else if (GetLastError() == ERROR_ACCESS_DENIED)