summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Baulig <martin@src.gnome.org>1998-10-26 09:53:08 +0000
committerMartin Baulig <martin@src.gnome.org>1998-10-26 09:53:08 +0000
commitbdc4e08454cb6d175f4e6e36e5a63aa46dae09b5 (patch)
tree90a3ccd5434bb006bc36e608670626a4e5090355 /include
parent65e3bf19ab663e7322a363e722da90573e37c744 (diff)
downloadlibgtop-bdc4e08454cb6d175f4e6e36e5a63aa46dae09b5.tar.gz
Added new feature (proc_args) to get command line arguments:
typedef struct _glibtop_proc_args glibtop_proc_args; struct _glibtop_proc_args { u_int64_t flags, size; /* GLIBTOP_PROC_ARGS_SIZE */ }; Returns a string containing all command line arguments of the process, the `unsigned' parameter is the maximum length of this string; if it is zero then no limit will be set. extern const char *glibtop_get_proc_args_l __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
Diffstat (limited to 'include')
-rw-r--r--include/glibtop/Makefile.am2
-rw-r--r--include/glibtop/command.h11
-rw-r--r--include/glibtop/procargs.h73
-rw-r--r--include/glibtop/sysdeps.h12
-rw-r--r--include/glibtop/union.h2
5 files changed, 89 insertions, 11 deletions
diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am
index 95558e52..35ef25dd 100644
--- a/include/glibtop/Makefile.am
+++ b/include/glibtop/Makefile.am
@@ -7,4 +7,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
procsegment.h read.h sysdeps.h xmalloc.h global.h \
procsignal.h read_data.h union.h types.h gnuserv.h \
parameter.h mountlist.h fsusage.h procmap.h signal.h \
- inodedb.h sysinfo.h ppp.h
+ inodedb.h sysinfo.h ppp.h procargs.h
diff --git a/include/glibtop/command.h b/include/glibtop/command.h
index f543b842..9064e3df 100644
--- a/include/glibtop/command.h
+++ b/include/glibtop/command.h
@@ -48,13 +48,14 @@ __BEGIN_DECLS
#define GLIBTOP_CMND_PROC_SIGNAL 15
#define GLIBTOP_CMND_PROC_KERNEL 16
#define GLIBTOP_CMND_PROC_SEGMENT 17
-#define GLIBTOP_CMND_PROC_MAP 18
+#define GLIBTOP_CMND_PROC_ARGS 18
+#define GLIBTOP_CMND_PROC_MAP 19
-#define GLIBTOP_CMND_MOUNTLIST 19
-#define GLIBTOP_CMND_FSUSAGE 20
-#define GLIBTOP_CMND_PPP 21
+#define GLIBTOP_CMND_MOUNTLIST 20
+#define GLIBTOP_CMND_FSUSAGE 21
+#define GLIBTOP_CMND_PPP 22
-#define GLIBTOP_MAX_CMND 22
+#define GLIBTOP_MAX_CMND 23
#define _GLIBTOP_PARAM_SIZE 16
diff --git a/include/glibtop/procargs.h b/include/glibtop/procargs.h
new file mode 100644
index 00000000..1ec6f5b7
--- /dev/null
+++ b/include/glibtop/procargs.h
@@ -0,0 +1,73 @@
+/* $Id$ */
+
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the Gnome Top Library.
+ Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
+
+ The Gnome Top Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The Gnome Top Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef __GLIBTOP_PROC_ARGS_H__
+#define __GLIBTOP_PROC_ARGS_H__
+
+#include <glibtop.h>
+#include <glibtop/global.h>
+
+__BEGIN_DECLS
+
+#define GLIBTOP_PROC_ARGS_SIZE 0
+
+#define GLIBTOP_MAX_PROC_ARGS 1
+
+typedef struct _glibtop_proc_args glibtop_proc_args;
+
+struct _glibtop_proc_args
+{
+ u_int64_t flags,
+ size; /* GLIBTOP_PROC_ARGS_SIZE */
+};
+
+#define glibtop_get_proc_args(proc_args,pid,max_len) glibtop_get_proc_args_l(glibtop_global_server, proc_args, pid, max_len)
+
+#if GLIBTOP_SUID_PROC_ARGS
+#define glibtop_get_proc_args_r glibtop_get_proc_args_p
+#else
+#define glibtop_get_proc_args_r glibtop_get_proc_args_s
+#endif
+
+extern const char *glibtop_get_proc_args_l __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
+
+#if GLIBTOP_SUID_PROC_ARGS
+extern void glibtop_init_proc_args_p __P((glibtop *));
+extern const char *glibtop_get_proc_args_p __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
+#else
+extern void glibtop_init_proc_args_s __P((glibtop *));
+extern const char *glibtop_get_proc_args_s __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
+#endif
+
+#ifdef GLIBTOP_NAMES
+
+/* You need to link with -lgtop_names to get this stuff here. */
+
+extern const char *glibtop_names_proc_args [];
+extern const unsigned glibtop_types_proc_args [];
+extern const char *glibtop_labels_proc_args [];
+extern const char *glibtop_descriptions_proc_args [];
+
+#endif
+
+__END_DECLS
+
+#endif
diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h
index 1d94bbab..9ec277b9 100644
--- a/include/glibtop/sysdeps.h
+++ b/include/glibtop/sysdeps.h
@@ -43,12 +43,13 @@ __BEGIN_DECLS
#define GLIBTOP_SYSDEPS_PROC_SIGNAL 14
#define GLIBTOP_SYSDEPS_PROC_KERNEL 15
#define GLIBTOP_SYSDEPS_PROC_SEGMENT 16
-#define GLIBTOP_SYSDEPS_PROC_MAP 17
-#define GLIBTOP_SYSDEPS_MOUNTLIST 18
-#define GLIBTOP_SYSDEPS_FSUSAGE 19
-#define GLIBTOP_SYSDEPS_PPP 20
+#define GLIBTOP_SYSDEPS_PROC_ARGS 17
+#define GLIBTOP_SYSDEPS_PROC_MAP 18
+#define GLIBTOP_SYSDEPS_MOUNTLIST 19
+#define GLIBTOP_SYSDEPS_FSUSAGE 20
+#define GLIBTOP_SYSDEPS_PPP 21
-#define GLIBTOP_MAX_SYSDEPS 21
+#define GLIBTOP_MAX_SYSDEPS 22
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
@@ -78,6 +79,7 @@ struct _glibtop_sysdeps
proc_signal, /* glibtop_proc_signal */
proc_kernel, /* glibtop_proc_kernel */
proc_segment, /* glibtop_proc_segment */
+ proc_args, /* glibtop_proc_args */
proc_map, /* glibtop_proc_map */
mountlist, /* glibtop_mountlist */
fsusage, /* glibtop_fsusage */
diff --git a/include/glibtop/union.h b/include/glibtop/union.h
index aa420f2f..68e30e2e 100644
--- a/include/glibtop/union.h
+++ b/include/glibtop/union.h
@@ -39,6 +39,7 @@
#include <glibtop/procsignal.h>
#include <glibtop/prockernel.h>
#include <glibtop/procsegment.h>
+#include <glibtop/procargs.h>
#include <glibtop/procmap.h>
#include <glibtop/mountlist.h>
@@ -68,6 +69,7 @@ union _glibtop_union
glibtop_proc_signal proc_signal;
glibtop_proc_kernel proc_kernel;
glibtop_proc_segment proc_segment;
+ glibtop_proc_args proc_args;
glibtop_proc_map proc_map;
glibtop_mountlist mountlist;
glibtop_fsusage fsusage;