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
e71e02d9
Commit
e71e02d9
authored
Jun 12, 2006
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code cleanup: make the WIN32 case less gratuitously different from
the other platform-specific cases in ps_status.
parent
e2e2a9db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
33 deletions
+24
-33
src/backend/utils/misc/ps_status.c
src/backend/utils/misc/ps_status.c
+24
-33
No files found.
src/backend/utils/misc/ps_status.c
View file @
e71e02d9
...
...
@@ -5,7 +5,7 @@
* to contain some useful information. Mechanism differs wildly across
* platforms.
*
* $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.
29 2006/03/05 15:58:49 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.
30 2006/06/12 02:39:49 tgl
Exp $
*
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
* various details abducted from various places
...
...
@@ -33,7 +33,7 @@
extern
char
**
environ
;
/*
------
/*
* Alternative ways of updating ps display:
*
* PS_USE_SETPROCTITLE
...
...
@@ -51,6 +51,8 @@ extern char **environ;
* PS_USE_CLOBBER_ARGV
* write over the argv and environment area
* (most SysV-like systems)
* PS_USE_WIN32
* push the string out as the name of a Windows event
* PS_USE_NONE
* don't update ps display
* (This is the default, as it is safest.)
...
...
@@ -65,7 +67,7 @@ extern char **environ;
#define PS_USE_CHANGE_ARGV
#elif defined(__linux__) || defined(_AIX) || defined(__sgi) || (defined(sun) && !defined(BSD)) || defined(ultrix) || defined(__ksr__) || defined(__osf__) || defined(__svr4__) || defined(__svr5__) || defined(__darwin__)
#define PS_USE_CLOBBER_ARGV
#elif defined
(WIN32)
#elif defined(WIN32)
#define PS_USE_WIN32
#else
#define PS_USE_NONE
...
...
@@ -96,30 +98,6 @@ static size_t ps_buffer_fixed_size; /* size of the constant prefix */
static
int
save_argc
;
static
char
**
save_argv
;
#ifdef WIN32
/*
* Win32 does not support showing any changed arguments. To make it at all
* possible to track which backend is doing what, we create a named object
* that can be viewed with for example Process Explorer
*/
static
HANDLE
ident_handle
=
INVALID_HANDLE_VALUE
;
static
void
pgwin32_update_ident
(
char
*
ident
)
{
char
name
[
PS_BUFFER_SIZE
+
32
];
if
(
ident_handle
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
ident_handle
);
sprintf
(
name
,
"pgident: %s"
,
ident
);
ident_handle
=
CreateEvent
(
NULL
,
TRUE
,
FALSE
,
name
);
}
#endif
/*
* Call this early in startup to save the original argc/argv values.
...
...
@@ -292,9 +270,6 @@ init_ps_display(const char *username, const char *dbname,
ps_buffer_fixed_size
=
strlen
(
ps_buffer
);
#ifdef WIN32
pgwin32_update_ident
(
ps_buffer
);
#endif
#endif
/* not PS_USE_NONE */
}
...
...
@@ -352,9 +327,25 @@ set_ps_display(const char *activity)
}
#endif
/* PS_USE_CLOBBER_ARGV */
#ifdef WIN32
pgwin32_update_ident
(
ps_buffer
);
#endif
#ifdef PS_USE_WIN32
{
/*
* Win32 does not support showing any changed arguments. To make it
* at all possible to track which backend is doing what, we create a
* named object that can be viewed with for example Process Explorer.
*/
static
HANDLE
ident_handle
=
INVALID_HANDLE_VALUE
;
char
name
[
PS_BUFFER_SIZE
+
32
];
if
(
ident_handle
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
ident_handle
);
sprintf
(
name
,
"pgident: %s"
,
ps_buffer
);
ident_handle
=
CreateEvent
(
NULL
,
TRUE
,
FALSE
,
name
);
}
#endif
/* PS_USE_WIN32 */
#endif
/* not PS_USE_NONE */
}
...
...
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