summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wong <markwkm@gmail.com>2013-03-27 16:54:49 -0700
committerMark Wong <markwkm@gmail.com>2013-03-27 16:54:49 -0700
commitef7ca10ac3149bff0028792eb522e77e10c7f0ba (patch)
tree7f80a58544cbfd79b7b2423f5e9f0569b9c20444
parent0d9ef3a7a42690590e37cd9a93252e135f6b781b (diff)
Current query only for linux
Disable the mode toggling for getting the current query until it can be implemented on platforms other than linux.
-rw-r--r--machine.h5
-rw-r--r--pg_top.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/machine.h b/machine.h
index c7759e9..113ef40 100644
--- a/machine.h
+++ b/machine.h
@@ -95,8 +95,13 @@ struct process_select
/* routines defined by the machine dependent module */
int machine_init(struct statics *);
void get_system_info(struct system_info *);
+#ifdef __linux__
caddr_t get_process_info(struct system_info *, struct process_select *, int,
char *, int);
+#else
+caddr_t get_process_info(struct system_info *, struct process_select *, int,
+ char *);
+#endif /* __linux__ */
char *format_header(char *);
char *format_next_io(caddr_t, char *(*) (uid_t));
char *format_next_process(caddr_t, char *(*) (uid_t));
diff --git a/pg_top.c b/pg_top.c
index 8adea92..7b22b1e 100644
--- a/pg_top.c
+++ b/pg_top.c
@@ -789,7 +789,11 @@ Usage: %s [-ITWbcinqru] [-x x] [-s x] [-o field] [-z username]\n\
if (mode_remote == 0)
{
get_system_info(&system_info);
+#ifdef __linux__
(void) get_process_info(&system_info, &ps, 0, conninfo, mode);
+#else
+ (void) get_process_info(&system_info, &ps, 0, conninfo);
+#endif /* __linux__ */
}
else
{
@@ -823,8 +827,13 @@ Usage: %s [-ITWbcinqru] [-x x] [-s x] [-o field] [-z username]\n\
if (mode_remote == 0)
{
get_system_info(&system_info);
+#ifdef __linux__
processes = get_process_info(&system_info, &ps, tmp_index,
conninfo, mode);
+#else
+ processes = get_process_info(&system_info, &ps, tmp_index,
+ conninfo);
+#endif /* __linux__ */
}
else
{