Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6f21f4ad
Commit
6f21f4ad
authored
May 27, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move pgkill out into /port so pg_ctl can use it on Win32.
parent
d157b7bb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
46 deletions
+67
-46
configure
configure
+1
-0
configure.in
configure.in
+2
-1
src/backend/port/win32/signal.c
src/backend/port/win32/signal.c
+1
-41
src/include/port/win32.h
src/include/port/win32.h
+4
-4
src/port/kill.c
src/port/kill.c
+59
-0
No files found.
configure
View file @
6f21f4ad
...
...
@@ -12014,6 +12014,7 @@ esac
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
...
...
configure.in
View file @
6f21f4ad
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.35
8 2004/05/22 00:34:49 tgl
Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.35
9 2004/05/27 13:08:48 momjian
Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
...
...
@@ -891,6 +891,7 @@ esac
case $host_os in mingw*)
AC_LIBOBJ(copydir)
AC_LIBOBJ(gettimeofday)
AC_LIBOBJ(kill)
AC_LIBOBJ(open)
AC_LIBOBJ(rand) ;;
esac
...
...
src/backend/port/win32/signal.c
View file @
6f21f4ad
...
...
@@ -6,7 +6,7 @@
* 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 $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -152,46 +152,6 @@ pqsignal(int signum, pqsigfunc handler)
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!
...
...
src/include/port/win32.h
View file @
6f21f4ad
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.2
3 2004/04/22 03:51:2
4 momjian Exp $ */
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.2
4 2004/05/27 13:08:5
4 momjian Exp $ */
/* undefine and redefine after #include */
#undef mkdir
...
...
@@ -116,10 +116,10 @@ void pg_queue_signal(int signum);
#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
...
...
src/port/kill.c
0 → 100644
View file @
6f21f4ad
/*-------------------------------------------------------------------------
*
* 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment