diff options
author | Martin Baulig <baulig@suse.de> | 2001-04-20 21:06:35 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 2001-04-20 21:06:35 +0000 |
commit | 7a7c6baf5593bba0fe1828687a3b0c6b837b160a (patch) | |
tree | 83f58dc2d2e1e3a6be8323d320175a958345344d /sysdeps/stub_suid | |
parent | 5bfb0850210fe27cba28794d85e0343ef37bb256 (diff) | |
download | libgtop-7a7c6baf5593bba0fe1828687a3b0c6b837b160a.tar.gz |
Moved all sysdeps code to the new libgtop-backends module.
2001-04-20 Martin Baulig <baulig@suse.de>
Moved all sysdeps code to the new libgtop-backends module.
* sysdeps/freesd/*: Removed.
* sysdeps/kernel/*: Removed.
* sysdeps/linux/*: Removed.
* sysdeps/osf1/*: Removed.
* sysdeps/solaris/*: Removed.
* sysdeps/stub/*: Removed.
* sysdeps/stub_suid/*: Removed.
* sysdeps/sun4/*: Removed.
Diffstat (limited to 'sysdeps/stub_suid')
32 files changed, 0 insertions, 1750 deletions
diff --git a/sysdeps/stub_suid/.cvsignore b/sysdeps/stub_suid/.cvsignore deleted file mode 100644 index d15c76bc..00000000 --- a/sysdeps/stub_suid/.cvsignore +++ /dev/null @@ -1,28 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -close.lo -cpu.lo -init.lo -libgtop_sysdeps.la -loadavg.lo -mem.lo -msg_limits.lo -open.lo -prockernel.lo -proclist.lo -procmem.lo -procsegment.lo -procsignal.lo -procstate.lo -proctime.lo -procuid.lo -sem_limits.lo -shm_limits.lo -swap.lo -sysdeps.lo -uptime.lo -*.lo -*.la -so_locations diff --git a/sysdeps/stub_suid/ChangeLog b/sysdeps/stub_suid/ChangeLog deleted file mode 100644 index f28dba14..00000000 --- a/sysdeps/stub_suid/ChangeLog +++ /dev/null @@ -1,23 +0,0 @@ -2000-02-06 Martin Baulig <martin@home-of-linux.org> - - * Makefile.am: Removed the non-suid `libgtop-sysdeps.la'. - * nosuid.c: Removed. - -1999-12-26 Martin Baulig <martin@home-of-linux.org> - - * netinfo.c: New file. - -1998-10-26 Martin Baulig <martin@home-of-linux.org> - - * netload.c: New file. - -1998-10-26 Martin Baulig <martin@home-of-linux.org> - - * procargs.c: New file. - * procmap.c: New file. - -1998-10-25 Martin Baulig <martin@home-of-linux.org> - - * ChangeLog: New file. - * ppp.c: New file. - diff --git a/sysdeps/stub_suid/Makefile.am b/sysdeps/stub_suid/Makefile.am deleted file mode 100644 index c7605cb2..00000000 --- a/sysdeps/stub_suid/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ - -INCLUDES = @INCLUDES@ - -lib_LTLIBRARIES = libgtop_sysdeps_suid.la - -libgtop_sysdeps_suid_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ - uptime.c loadavg.c shm_limits.c msg_limits.c \ - sem_limits.c proclist.c procstate.c procuid.c \ - proctime.c procmem.c procsignal.c prockernel.c \ - procsegment.c procargs.c procmap.c netload.c \ - netinfo.c interfaces.c ppp.c - -libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO) - -include_HEADERS = glibtop_server.h glibtop_machine.h - -noinst_HEADERS = glibtop_suid.h diff --git a/sysdeps/stub_suid/close.c b/sysdeps/stub_suid/close.c deleted file mode 100644 index 3378b817..00000000 --- a/sysdeps/stub_suid/close.c +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop/close.h> - -/* Closes pipe to gtop server. */ - -void -glibtop_close_s (glibtop *server) -{ } diff --git a/sysdeps/stub_suid/cpu.c b/sysdeps/stub_suid/cpu.c deleted file mode 100644 index 6ec05b68..00000000 --- a/sysdeps/stub_suid/cpu.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/cpu.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_cpu = 0; - -/* Init function. */ - -int -glibtop_init_cpu_p (glibtop *server) -{ - server->sysdeps.cpu = _glibtop_sysdeps_cpu; - - return 0; -} - -/* Provides information about cpu usage. */ - -int -glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_CPU, 0); - - memset (buf, 0, sizeof (glibtop_cpu)); - - return 0; -} diff --git a/sysdeps/stub_suid/glibtop_machine.h b/sysdeps/stub_suid/glibtop_machine.h deleted file mode 100644 index a0faf8b8..00000000 --- a/sysdeps/stub_suid/glibtop_machine.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. 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__ - -BEGIN_LIBGTOP_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 */ -}; - -END_LIBGTOP_DECLS - -#endif diff --git a/sysdeps/stub_suid/glibtop_server.h b/sysdeps/stub_suid/glibtop_server.h deleted file mode 100644 index d7e032d9..00000000 --- a/sysdeps/stub_suid/glibtop_server.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef __GLIBTOP_SERVER_H__ -#define __GLIBTOP_SERVER_H__ - -BEGIN_LIBGTOP_DECLS - -#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) -#define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) -#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) -#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) -#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) -#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) -#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) -#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) -#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) -#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) -#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) -#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) -#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) -#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) -#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) -#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) -#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) -#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) -#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) -#define GLIBTOP_SUID_NETINFO (1 << GLIBTOP_SYSDEPS_NETINFO) -#define GLIBTOP_SUID_INTERFACE_NAMES (1 << GLIBTOP_SYSDEPS_INTERFACE_NAMES) -#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) - -END_LIBGTOP_DECLS - -#endif diff --git a/sysdeps/stub_suid/glibtop_suid.h b/sysdeps/stub_suid/glibtop_suid.h deleted file mode 100644 index 3923f034..00000000 --- a/sysdeps/stub_suid/glibtop_suid.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef __GLIBTOP_SUID_H__ -#define __GLIBTOP_SUID_H__ - -BEGIN_LIBGTOP_DECLS - -static inline void glibtop_suid_enter (glibtop *server) { - setreuid (server->_priv->machine.uid, server->_priv->machine.euid); -}; - -static inline void glibtop_suid_leave (glibtop *server) { - if (setreuid (server->_priv->machine.euid, server->_priv->machine.uid)) - _exit (1); -}; - -void -glibtop_init_p (glibtop *server, const unsigned long features, - const unsigned flags); -void -glibtop_open_p (glibtop *server, const char *program_name, - const unsigned long features, - const unsigned flags); - -END_LIBGTOP_DECLS - -#endif diff --git a/sysdeps/stub_suid/init.c b/sysdeps/stub_suid/init.c deleted file mode 100644 index 53e2453a..00000000 --- a/sysdeps/stub_suid/init.c +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/open.h> - -static glibtop _glibtop_global_server; -glibtop *glibtop_global_server = NULL; - -glibtop * -glibtop_init_r (glibtop **server, - const unsigned long features, - const unsigned flags) -{ - if (*server != NULL) - return *server; - - if (glibtop_global_server == NULL) { - glibtop_global_server = &_glibtop_global_server; - glibtop_open (glibtop_global_server, "glibtop", - features, flags); - } - - return *server = glibtop_global_server; -} diff --git a/sysdeps/stub_suid/interfaces.c b/sysdeps/stub_suid/interfaces.c deleted file mode 100644 index b9dd54a0..00000000 --- a/sysdeps/stub_suid/interfaces.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/interfaces.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_interface_names = -(1L << GLIBTOP_INTERFACE_NAMES_NUMBER) + -(1L << GLIBTOP_INTERFACE_NAMES_SIZE); - -/* Init function. */ - -int -glibtop_init_interface_names_p (glibtop *server) -{ - server->sysdeps.interface_names = _glibtop_sysdeps_interface_names; - - return 0; -} - -/* Provides network statistics. */ - -glibtop_interface * -glibtop_get_interface_names_p (glibtop *server, glibtop_array *array, - u_int64_t interface, u_int64_t number, - u_int64_t instance, u_int64_t strategy) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0); - - memset (array, 0, sizeof (glibtop_array)); - - return NULL; -} diff --git a/sysdeps/stub_suid/loadavg.c b/sysdeps/stub_suid/loadavg.c deleted file mode 100644 index f713d5db..00000000 --- a/sysdeps/stub_suid/loadavg.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/loadavg.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_loadavg = 0; - -/* Init function. */ - -int -glibtop_init_loadavg_p (glibtop *server) -{ - server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; - - return 0; -} - -/* Provides load averange. */ - -int -glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_LOADAVG, 0); - - memset (buf, 0, sizeof (glibtop_loadavg)); - - return 0; -} diff --git a/sysdeps/stub_suid/mem.c b/sysdeps/stub_suid/mem.c deleted file mode 100644 index 430e5062..00000000 --- a/sysdeps/stub_suid/mem.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/mem.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_mem = 0; - -/* Init function. */ - -int -glibtop_init_mem_p (glibtop *server) -{ - server->sysdeps.mem = _glibtop_sysdeps_mem; - - return 0; -} - -/* Provides information about memory usage. */ - -int -glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_MEM, 0); - - memset (buf, 0, sizeof (glibtop_mem)); - - return 0; -} diff --git a/sysdeps/stub_suid/msg_limits.c b/sysdeps/stub_suid/msg_limits.c deleted file mode 100644 index efb0f958..00000000 --- a/sysdeps/stub_suid/msg_limits.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/msg_limits.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_msg_limits = 0; - -/* Init function. */ - -int -glibtop_init_msg_limits_p (glibtop *server) -{ - server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; - - return 0; -} - -/* Provides information about sysv ipc limits. */ - -int -glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0); - - memset (buf, 0, sizeof (glibtop_msg_limits)); - - return 0; -} diff --git a/sysdeps/stub_suid/netinfo.c b/sysdeps/stub_suid/netinfo.c deleted file mode 100644 index ffb19d67..00000000 --- a/sysdeps/stub_suid/netinfo.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/netinfo.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_netinfo = 0; - -/* Init function. */ - -int -glibtop_init_netinfo_p (glibtop *server) -{ - server->sysdeps.netinfo = _glibtop_sysdeps_netinfo; - - return 0; -} - -/* Provides Network statistics. */ - -int -glibtop_get_netinfo_p (glibtop *server, glibtop_netinfo *buf, - const char *interface, unsigned transport) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_NETINFO, 0); - - memset (buf, 0, sizeof (glibtop_netinfo)); - - return 0; -} diff --git a/sysdeps/stub_suid/netload.c b/sysdeps/stub_suid/netload.c deleted file mode 100644 index adfb1d16..00000000 --- a/sysdeps/stub_suid/netload.c +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/netload.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_netload = 0; - -/* Init function. */ - -int -glibtop_init_netload_p (glibtop *server) -{ - server->sysdeps.netload = _glibtop_sysdeps_netload; - - return 0; -} - -/* Provides Network statistics. */ - -int -glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, - const char *interface, unsigned transport, - unsigned protocol) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_NETLOAD, 0); - - memset (buf, 0, sizeof (glibtop_netload)); - - return 0; -} diff --git a/sysdeps/stub_suid/open.c b/sysdeps/stub_suid/open.c deleted file mode 100644 index 2d20b2bd..00000000 --- a/sysdeps/stub_suid/open.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/open.h> -#include <glibtop/xmalloc.h> - -/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */ - -void -glibtop_init_p (glibtop *server, const unsigned long features, - const unsigned flags) -{ - glibtop_init_func_t *init_fkt; - - if (server == NULL) - glibtop_error_r (NULL, "glibtop_init_p (server == NULL)"); - - /* Do the initialization, but only if not already initialized. */ - - if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) { - glibtop_open_p (server, "glibtop", features, flags); - - for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++) - (*init_fkt) (server); - - server->flags |= _GLIBTOP_INIT_STATE_INIT; - } -} - -void -glibtop_open_p (glibtop *server, const char *program_name, - const unsigned long features, const unsigned flags) -{ - /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ - - server->name = program_name; - - server->_priv->machine.uid = getuid (); - server->_priv->machine.euid = geteuid (); - server->_priv->machine.gid = getgid (); - server->_priv->machine.egid = getegid (); - - /* Drop priviledges. */ - - if (setreuid (server->_priv->machine.euid, server->_priv->machine.uid)) - _exit (1); - - if (setregid (server->_priv->machine.egid, server->_priv->machine.gid)) - _exit (1); - - /* !!! END OF SUID ROOT PART !!! */ - - /* Our effective uid is now those of the user invoking the server, - * so we do no longer have any priviledges. */ -} - diff --git a/sysdeps/stub_suid/ppp.c b/sysdeps/stub_suid/ppp.c deleted file mode 100644 index cfbcddec..00000000 --- a/sysdeps/stub_suid/ppp.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/ppp.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_ppp = 0; - -/* Init function. */ - -int -glibtop_init_ppp_p (glibtop *server) -{ - server->sysdeps.ppp = _glibtop_sysdeps_ppp; - - return 0; -} - -/* Provides PPP/ISDN information. */ - -int -glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device, - unsigned short isdn) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PPP, 0); - - memset (buf, 0, sizeof (glibtop_ppp)); - - return 0; -} diff --git a/sysdeps/stub_suid/procargs.c b/sysdeps/stub_suid/procargs.c deleted file mode 100644 index 980b0ba3..00000000 --- a/sysdeps/stub_suid/procargs.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/xmalloc.h> -#include <glibtop/procargs.h> - -static const unsigned long _glibtop_sysdeps_proc_args = 0; - -/* Init function. */ - -int -glibtop_init_proc_args_p (glibtop *server) -{ - server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; - - return 0; -} - -/* Provides detailed information about a process. */ - -char ** -glibtop_get_proc_args_p (glibtop *server, glibtop_array *array, pid_t pid) -{ - memset (array, 0, sizeof (glibtop_array)); - return NULL; -} diff --git a/sysdeps/stub_suid/procdata.c b/sysdeps/stub_suid/procdata.c deleted file mode 100644 index 1d22e8ee..00000000 --- a/sysdeps/stub_suid/procdata.c +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop/procdata.h> - -#include <sys/stat.h> - -#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) - -#define BIT_SHIFT(x) (1L << (x % 32)) - -static const unsigned long _glibtop_sysdeps_procdata_0 = -BIT_SHIFT(GLIBTOP_PROCDATA_CMD) + -BIT_SHIFT(GLIBTOP_PROCDATA_STATE) + -BIT_SHIFT(GLIBTOP_PROCDATA_UID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PPID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PGRP) + -BIT_SHIFT(GLIBTOP_PROCDATA_SESSION) + -BIT_SHIFT(GLIBTOP_PROCDATA_TTY) + -BIT_SHIFT(GLIBTOP_PROCDATA_TPGID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PRIORITY) + -BIT_SHIFT(GLIBTOP_PROCDATA_NICE) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIGNAL) + -BIT_SHIFT(GLIBTOP_PROCDATA_BLOCKED) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIGIGNORE) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIGCATCH) + -BIT_SHIFT(GLIBTOP_PROCDATA_START_TIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_UTIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_STIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_CUTIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_CSTIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIZE) + -BIT_SHIFT(GLIBTOP_PROCDATA_RESIDENT) + -BIT_SHIFT(GLIBTOP_PROCDATA_SHARE) + -BIT_SHIFT(GLIBTOP_PROCDATA_TRS) + -BIT_SHIFT(GLIBTOP_PROCDATA_LRS) + -BIT_SHIFT(GLIBTOP_PROCDATA_DRS) + -BIT_SHIFT(GLIBTOP_PROCDATA_DT) + -BIT_SHIFT(GLIBTOP_PROCDATA_VSIZE) + -BIT_SHIFT(GLIBTOP_PROCDATA_RSS) + -BIT_SHIFT(GLIBTOP_PROCDATA_RSS_RLIM) + -BIT_SHIFT(GLIBTOP_PROCDATA_TIMEOUT) + -BIT_SHIFT(GLIBTOP_PROCDATA_IT_REAL_VALUE); - -static const unsigned long _glibtop_sysdeps_procdata_1 = -BIT_SHIFT(GLIBTOP_PROCDATA_K_FLAGS) + -BIT_SHIFT(GLIBTOP_PROCDATA_MIN_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_MAJ_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_CMIN_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_CMAJ_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_START_CODE) + -BIT_SHIFT(GLIBTOP_PROCDATA_END_CODE) + -BIT_SHIFT(GLIBTOP_PROCDATA_START_STACK) + -BIT_SHIFT(GLIBTOP_PROCDATA_KSTK_ESP) + -BIT_SHIFT(GLIBTOP_PROCDATA_KSTK_EIP) + -BIT_SHIFT(GLIBTOP_PROCDATA_WCHAN); - -/* Provides detailed information about a process. */ - -void -glibtop_get_procdata_s (glibtop *server, glibtop_procdata *buf, pid_t pid) -{ - char input [BUFSIZ], *tmp; - struct stat statb; - int nread; - FILE *f; - - glibtop_init_r (&server, 0, 0); - - memset (buf, 0, sizeof (glibtop_procdata)); - - if (pid == 0) { - /* Client is only interested in the flags. */ - buf->flags [0] = _glibtop_sysdeps_procdata_0; - buf->flags [1] = _glibtop_sysdeps_procdata_1; - return; - } - - - sprintf (input, "/proc/%d/stat", pid); - - if (stat (input, &statb)) return; - - buf->uid = statb.st_uid; - - f = fopen (input, "r"); - if (!f) return; - - nread = fread (input, 1, BUFSIZ, f); - - if (nread < 0) { - fclose (f); - return; - } - - input [nread] = 0; - - /* This is from guile-utils/gtop/proc/readproc.c */ - - /* split into "PID (cmd" and "<rest>" */ - tmp = strrchr (input, ')'); - *tmp = '\0'; /* replace trailing ')' with NUL */ - /* parse these two strings separately, skipping the leading "(". */ - memset (buf->cmd, 0, sizeof (buf->cmd)); - sscanf (input, "%d (%39c", &buf->pid, buf->cmd); - sscanf(tmp + 2, /* skip space after ')' too */ - "%c %d %d %d %d %d %lu %lu %lu %lu %lu " - "%ld %ld %ld %ld %d %d %lu %lu %ld %lu " - "%lu %lu %lu %lu %lu %lu %lu %d %d %d %d %lu", - &buf->state, &buf->ppid, &buf->pgrp, &buf->session, - &buf->tty, &buf->tpgid, &buf->k_flags, &buf->min_flt, - &buf->cmin_flt, &buf->maj_flt, &buf->cmaj_flt, - &buf->utime, &buf->stime, &buf->cutime, &buf->cstime, - &buf->priority, &buf->nice, &buf->timeout, - &buf->it_real_value, &buf->start_time, &buf->vsize, - &buf->rss, &buf->rss_rlim, &buf->start_code, - &buf->end_code, &buf->start_stack, &buf->kstk_esp, - &buf->kstk_eip, &buf->signal, &buf->blocked, - &buf->sigignore, &buf->sigcatch, &buf->wchan); - - if (buf->tty == 0) - /* the old notty val, update elsewhere bef. moving to 0 */ - buf->tty = -1; - - if (server->os_version_code < LINUX_VERSION(1,3,39)) { - /* map old meanings to new */ - buf->priority = 2*15 - buf->priority; - buf->nice = 15 - buf->nice; - } - if (server->os_version_code < LINUX_VERSION(1,1,30) && buf->tty != -1) - /* when tty wasn't full devno */ - buf->tty = 4*0x100 + buf->tty; - - fclose (f); - - sprintf (input, "/proc/%d/statm", pid); - - f = fopen (input, "r"); - if (!f) return; - - nread = fread (input, 1, BUFSIZ, f); - - if (nread < 0) { - fclose (f); - return; - } - - input [nread] = 0; - - sscanf (input, "%ld %ld %ld %ld %ld %ld %ld", - &buf->size, &buf->resident, &buf->share, - &buf->trs, &buf->lrs, &buf->drs, &buf->dt); - - fclose (f); - - buf->flags [0] = _glibtop_sysdeps_procdata_0; - buf->flags [1] = _glibtop_sysdeps_procdata_1; -} diff --git a/sysdeps/stub_suid/prockernel.c b/sysdeps/stub_suid/prockernel.c deleted file mode 100644 index 135dbad0..00000000 --- a/sysdeps/stub_suid/prockernel.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/prockernel.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_kernel = 0; - -/* Init function. */ - -int -glibtop_init_proc_kernel_p (glibtop *server) -{ - server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; - - return 0; -} - -/* Provides detailed information about a process. */ - -int -glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0); - - memset (buf, 0, sizeof (glibtop_proc_kernel)); - - return 0; -} diff --git a/sysdeps/stub_suid/proclist.c b/sysdeps/stub_suid/proclist.c deleted file mode 100644 index cb025248..00000000 --- a/sysdeps/stub_suid/proclist.c +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/proclist.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proclist = 0; - -/* Init function. */ - -int -glibtop_init_proclist_p (glibtop *server) -{ - server->sysdeps.proclist = _glibtop_sysdeps_proclist; - - return 0; -} - -unsigned * -glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, - int64_t which, int64_t arg) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROCLIST, 0); - - memset (buf, 0, sizeof (glibtop_proclist)); - - return NULL; -} diff --git a/sysdeps/stub_suid/procmap.c b/sysdeps/stub_suid/procmap.c deleted file mode 100644 index 34aafda3..00000000 --- a/sysdeps/stub_suid/procmap.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/xmalloc.h> -#include <glibtop/procmap.h> - -static const unsigned long _glibtop_sysdeps_proc_map = 0; - -/* Init function. */ - -int -glibtop_init_proc_map_p (glibtop *server) -{ - server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; - - return 0; -} - -/* Provides detailed information about a process. */ - -glibtop_map_entry * -glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid) -{ - memset (buf, 0, sizeof (glibtop_proc_map)); - return NULL; -} diff --git a/sysdeps/stub_suid/procmem.c b/sysdeps/stub_suid/procmem.c deleted file mode 100644 index ad99456e..00000000 --- a/sysdeps/stub_suid/procmem.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procmem.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_mem = 0; - -/* Init function. */ - -int -glibtop_init_proc_mem_p (glibtop *server) -{ - server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; - - return 0; -} - -/* Provides detailed information about a process. */ - -int -glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_MEM, 0); - - memset (buf, 0, sizeof (glibtop_proc_mem)); - - return 0; -} diff --git a/sysdeps/stub_suid/procsegment.c b/sysdeps/stub_suid/procsegment.c deleted file mode 100644 index 7ef6cf94..00000000 --- a/sysdeps/stub_suid/procsegment.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procsegment.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_segment = 0; - -/* Init function. */ - -int -glibtop_init_proc_segment_p (glibtop *server) -{ - server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; - - return 0; -} - -/* Provides detailed information about a process. */ - -int -glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0); - - memset (buf, 0, sizeof (glibtop_proc_segment)); - - return 0; -} diff --git a/sysdeps/stub_suid/procsignal.c b/sysdeps/stub_suid/procsignal.c deleted file mode 100644 index 4cf8722a..00000000 --- a/sysdeps/stub_suid/procsignal.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procsignal.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_signal = 0; - -/* Init function. */ - -int -glibtop_init_proc_signal_p (glibtop *server) -{ - server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; - - return 0; -} - -/* Provides detailed information about a process. */ - -int -glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0); - - memset (buf, 0, sizeof (glibtop_proc_signal)); - - return 0; -} diff --git a/sysdeps/stub_suid/procstate.c b/sysdeps/stub_suid/procstate.c deleted file mode 100644 index 6fb412f1..00000000 --- a/sysdeps/stub_suid/procstate.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procstate.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_state = 0; - -/* Init function. */ - -int -glibtop_init_proc_state_p (glibtop *server) -{ - server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; - - return 0; -} - -/* Provides detailed information about a process. */ - -int -glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_STATE, 0); - - memset (buf, 0, sizeof (glibtop_proc_state)); - - return 0; -} diff --git a/sysdeps/stub_suid/proctime.c b/sysdeps/stub_suid/proctime.c deleted file mode 100644 index 39151d21..00000000 --- a/sysdeps/stub_suid/proctime.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/proctime.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_time = 0; - -/* Init function. */ - -int -glibtop_init_proc_time_p (glibtop *server) -{ - server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; - - return 0; -} - -/* Provides detailed information about a process. */ - -int -glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_TIME, 0); - - memset (buf, 0, sizeof (glibtop_proc_time)); - - return 0; -} diff --git a/sysdeps/stub_suid/procuid.c b/sysdeps/stub_suid/procuid.c deleted file mode 100644 index 38f36afc..00000000 --- a/sysdeps/stub_suid/procuid.c +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procuid.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_uid = 0; - -/* Init function. */ - -int -glibtop_init_proc_uid_p (glibtop *server) -{ - server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; - - return 0; -} - -/* Provides detailed information about a process. */ - -int -glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_UID, 0); - - memset (buf, 0, sizeof (glibtop_proc_uid)); - - return 0; -} diff --git a/sysdeps/stub_suid/sem_limits.c b/sysdeps/stub_suid/sem_limits.c deleted file mode 100644 index d574052b..00000000 --- a/sysdeps/stub_suid/sem_limits.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/sem_limits.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_sem_limits = 0; - -/* Init function. */ - -int -glibtop_init_sem_limits_p (glibtop *server) -{ - server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; - - return 0; -} - -/* Provides information about sysv sem limits. */ - -int -glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0); - - memset (buf, 0, sizeof (glibtop_sem_limits)); - - return 0; -} diff --git a/sysdeps/stub_suid/shm_limits.c b/sysdeps/stub_suid/shm_limits.c deleted file mode 100644 index 7246a592..00000000 --- a/sysdeps/stub_suid/shm_limits.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/shm_limits.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_shm_limits = 0; - -/* Init function. */ - -int -glibtop_init_shm_limits_p (glibtop *server) -{ - server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; - - return 0; -} - -/* Provides information about sysv ipc limits. */ - -int -glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0); - - memset (buf, 0, sizeof (glibtop_shm_limits)); - - return 0; -} diff --git a/sysdeps/stub_suid/swap.c b/sysdeps/stub_suid/swap.c deleted file mode 100644 index e5fe5d0d..00000000 --- a/sysdeps/stub_suid/swap.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/swap.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_swap = 0; - -/* Init function. */ - -int -glibtop_init_swap_p (glibtop *server) -{ - server->sysdeps.swap = _glibtop_sysdeps_swap; - - return 0; -} - -/* Provides information about swap usage. */ - -int -glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_SWAP, 0); - - memset (buf, 0, sizeof (glibtop_swap)); - - return 0; -} diff --git a/sysdeps/stub_suid/uptime.c b/sysdeps/stub_suid/uptime.c deleted file mode 100644 index b627ccdd..00000000 --- a/sysdeps/stub_suid/uptime.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/uptime.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_uptime = 0; - -/* Init function. */ - -int -glibtop_init_uptime_p (glibtop *server) -{ - server->sysdeps.uptime = _glibtop_sysdeps_uptime; - - return 0; -} - -/* Provides uptime and idle time. */ - -int -glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_UPTIME, 0); - - memset (buf, 0, sizeof (glibtop_uptime)); - - return 0; -} |