summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin@src.gnome.org>1998-05-23 23:03:59 +0000
committerMartin Baulig <martin@src.gnome.org>1998-05-23 23:03:59 +0000
commit37e161bcecf014c2035905d6c0b4f92c83c86895 (patch)
treefc4200b6e79c2ef33e569ce2b590112d430a7fd6
parent00176cd6e81f90bb055910c0be798de0ec8ea46b (diff)
downloadlibgtop-37e161bcecf014c2035905d6c0b4f92c83c86895.tar.gz
New file. System dependend header file for SunOS.
* sysdeps/sun4/glibtop_machine.h: New file. System dependend header file for SunOS.
-rw-r--r--sysdeps/sun4/glibtop_machine.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/sysdeps/sun4/glibtop_machine.h b/sysdeps/sun4/glibtop_machine.h
new file mode 100644
index 00000000..3fbb0251
--- /dev/null
+++ b/sysdeps/sun4/glibtop_machine.h
@@ -0,0 +1,97 @@
+/* $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_MACHINE_H__
+#define __GLIBTOP_MACHINE_H__
+
+/* make sure param.h gets loaded with KERNEL defined to get PZERO & NZERO */
+#define KERNEL
+#include <sys/param.h>
+#undef KERNEL
+
+#include <stdio.h>
+#include <kvm.h>
+#include <nlist.h>
+#include <math.h>
+#include <sys/dir.h>
+#include <sys/user.h>
+#include <sys/proc.h>
+#include <sys/dk.h>
+#include <sys/vm.h>
+#include <sys/file.h>
+#include <sys/time.h>
+#include <vm/page.h>
+
+#ifdef solbourne
+#include <sys/syscall.h>
+#endif
+
+/* Older versions of SunOS don't have a typedef for pid_t.
+ Hopefully this will catch all those cases without causing other problems.
+ */
+#ifndef __sys_stdtypes_h
+typedef int pid_t;
+#endif
+
+/* definitions for indices in the nlist array */
+#define X_AVENRUN 0
+#define X_CCPU 1
+#define X_MPID 2
+#define X_NPROC 3
+#define X_PROC 4
+#define X_TOTAL 5
+#define X_CP_TIME 6
+#define X_PAGES 7
+#define X_EPAGES 8
+
+#ifdef MULTIPROCESSOR
+#define X_NCPU 9
+#define X_MP_TIME 10
+#endif
+
+__BEGIN_DECLS
+
+typedef struct _glibtop_machine glibtop_machine;
+
+struct _glibtop_machine
+{
+ uid_t uid, euid; /* Real and effective user id */
+ gid_t gid, egid; /* Real and effective group id */
+ int nlist_count; /* Number of symbols in the nlist */
+ int ncpu; /* Number of CPUs we have */
+ kvm_t *kd;
+};
+
+/* Those functions are used internally in libgtop */
+
+#ifdef _IN_LIBGTOP
+
+extern struct nlist _glibtop_nlist[];
+
+extern int _glibtop_check_nlist __P((void *, register struct nlist *));
+
+extern int _glibtop_getkval __P((void *, unsigned long, int *, int, char *));
+
+#endif
+
+__END_DECLS
+
+#endif