From 37e161bcecf014c2035905d6c0b4f92c83c86895 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sat, 23 May 1998 23:03:59 +0000 Subject: [PATCH] New file. System dependend header file for SunOS. * sysdeps/sun4/glibtop_machine.h: New file. System dependend header file for SunOS. --- sysdeps/sun4/glibtop_machine.h | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sysdeps/sun4/glibtop_machine.h 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 , 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 +#undef KERNEL + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef solbourne +#include +#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