From 0dc0c2d7f03d1702dabd5711a7b76f6a0f51512e Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 22 Jul 1998 17:21:59 +0000 Subject: [PATCH] Added `fsusage.[ch]' and `mountlist.[ch]'. 1998-07-22 Martin Baulig * sysdeps/common/Makefile.am (libgtop_common_la_SOURCES): Added `fsusage.[ch]' and `mountlist.[ch]'. * include/glibtop/signal.h: New file. * sysdeps/{kernel, linux, osf1, sun4, stub}/siglist.c: New files. --- ChangeLog | 9 ++++++ configure.in | 1 - include/glibtop/signal.h | 45 +++++++++++++++++++++++++++++ sysdeps/common/Makefile.am | 3 +- sysdeps/kernel/Makefile.am | 2 +- sysdeps/kernel/siglist.c | 58 ++++++++++++++++++++++++++++++++++++++ sysdeps/linux/Makefile.am | 2 +- sysdeps/linux/siglist.c | 58 ++++++++++++++++++++++++++++++++++++++ sysdeps/osf1/Makefile.am | 2 +- sysdeps/osf1/siglist.c | 58 ++++++++++++++++++++++++++++++++++++++ sysdeps/stub/Makefile.am | 2 +- sysdeps/stub/siglist.c | 26 +++++++++++++++++ sysdeps/sun4/Makefile.am | 2 +- sysdeps/sun4/siglist.c | 58 ++++++++++++++++++++++++++++++++++++++ 14 files changed, 319 insertions(+), 7 deletions(-) create mode 100644 include/glibtop/signal.h create mode 100644 sysdeps/kernel/siglist.c create mode 100644 sysdeps/linux/siglist.c create mode 100644 sysdeps/osf1/siglist.c create mode 100644 sysdeps/stub/siglist.c create mode 100644 sysdeps/sun4/siglist.c diff --git a/ChangeLog b/ChangeLog index 884d17f8..b05710db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1998-07-22 Martin Baulig + + * sysdeps/common/Makefile.am (libgtop_common_la_SOURCES): + Added `fsusage.[ch]' and `mountlist.[ch]'. + + * include/glibtop/signal.h: New file. + + * sysdeps/{kernel, linux, osf1, sun4, stub}/siglist.c: New files. + 1998-07-22 Martin Baulig * lib/init.c (glibtop_init_s): Added this init function of diff --git a/configure.in b/configure.in index c46d5a5b..2687ac2a 100644 --- a/configure.in +++ b/configure.in @@ -256,7 +256,6 @@ sysdeps/linux/Makefile sysdeps/kernel/Makefile src/Makefile src/server/Makefile -src/proxy/Makefile src/daemon/Makefile lib/Makefile examples/Makefile diff --git a/include/glibtop/signal.h b/include/glibtop/signal.h new file mode 100644 index 00000000..1e774d10 --- /dev/null +++ b/include/glibtop/signal.h @@ -0,0 +1,45 @@ +/* $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_SIGNAL_H__ +#define __GLIBTOP_SIGNAL_H__ + +#include + +#ifdef HAVE_SYS_SIGNAL_H +#include +#endif + +__BEGIN_DECLS + +typedef struct _glibtop_signame glibtop_signame; + +struct _glibtop_signame +{ + const int number; + const char *name, *label; +}; + +extern const glibtop_signame glibtop_sys_siglist []; + +__END_DECLS + +#endif diff --git a/sysdeps/common/Makefile.am b/sysdeps/common/Makefile.am index 74f9ee5e..dc9a8f1a 100644 --- a/sysdeps/common/Makefile.am +++ b/sysdeps/common/Makefile.am @@ -8,6 +8,7 @@ CFLAGS = -Wall -W @CFLAGS@ lib_LTLIBRARIES = libgtop_common.la libgtop_suid_common.la -libgtop_common_la_SOURCES = sysdeps.c xmalloc.c error.c gnuslib.c +libgtop_common_la_SOURCES = sysdeps.c xmalloc.c error.c gnuslib.c \ + fsusage.c fsusage.h mountlist.c mountlist.h libgtop_suid_common_la_SOURCES = xmalloc.c error.c diff --git a/sysdeps/kernel/Makefile.am b/sysdeps/kernel/Makefile.am index cad0a81e..b5db2723 100644 --- a/sysdeps/kernel/Makefile.am +++ b/sysdeps/kernel/Makefile.am @@ -12,7 +12,7 @@ libgtop_sysdeps_la_SOURCES = open.c close.c kernel.s 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 + procsegment.c siglist.c include_HEADERS = glibtop_server.h diff --git a/sysdeps/kernel/siglist.c b/sysdeps/kernel/siglist.c new file mode 100644 index 00000000..92b9d275 --- /dev/null +++ b/sysdeps/kernel/siglist.c @@ -0,0 +1,58 @@ +/* $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. */ + +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", NULL }, /* Hangup (POSIX). */ + { 2, "SIGINT", NULL }, /* Interrupt (ANSI). */ + { 3, "SIGQUIT", NULL }, /* Quit (POSIX). */ + { 4, "SIGILL", NULL }, /* Illegal instruction (ANSI). */ + { 5, "SIGTRAP", NULL }, /* Trace trap (POSIX). */ + { 6, "SIGABRT", NULL }, /* Abort (ANSI). */ + { 7, "SIGBUS", NULL }, /* BUS error (4.2 BSD). */ + { 8, "SIGFPE", NULL }, /* Floating-point exception (ANSI). */ + { 9, "SIGKILL", NULL }, /* Kill, unblockable (POSIX). */ + { 10, "SIGUSR1", NULL }, /* User-defined signal 1 (POSIX). */ + { 11, "SIGSEGV", NULL }, /* Segmentation violation (ANSI). */ + { 12, "SIGUSR2", NULL }, /* User-defined signal 2 (POSIX). */ + { 13, "SIGPIPE", NULL }, /* Broken pipe (POSIX). */ + { 14, "SIGALRM", NULL }, /* Alarm clock (POSIX). */ + { 15, "SIGTERM", NULL }, /* Termination (ANSI). */ + { 16, "SIGSTKFLT", NULL }, /* ??? */ + { 17, "SIGCHLD", NULL }, /* Child status has changed (POSIX). */ + { 18, "SIGCONT", NULL }, /* Continue (POSIX). */ + { 19, "SIGSTOP", NULL }, /* Stop, unblockable (POSIX). */ + { 20, "SIGTSTP", NULL }, /* Keyboard stop (POSIX). */ + { 21, "SIGTTIN", NULL }, /* Background read from tty (POSIX). */ + { 22, "SIGTTOU", NULL }, /* Background write to tty (POSIX). */ + { 23, "SIGURG", NULL }, /* Urgent condition on socket (4.2 BSD). */ + { 24, "SIGXCPU", NULL }, /* CPU limit exceeded (4.2 BSD). */ + { 25, "SIGXFSZ", NULL }, /* File size limit exceeded (4.2 BSD). */ + { 26, "SIGVTALRM", NULL }, /* Virtual alarm clock (4.2 BSD). */ + { 27, "SIGPROF", NULL }, /* Profiling alarm clock (4.2 BSD). */ + { 28, "SIGWINCH", NULL }, /* Window size change (4.3 BSD, Sun). */ + { 29, "SIGIO", NULL }, /* I/O now possible (4.2 BSD). */ + { 30, "SIGPWR", NULL }, /* Power failure restart (System V). */ + { 31, "SIGUNUSED", NULL }, + { 0, NULL, NULL }, +}; diff --git a/sysdeps/linux/Makefile.am b/sysdeps/linux/Makefile.am index 04962feb..24ffbfa6 100644 --- a/sysdeps/linux/Makefile.am +++ b/sysdeps/linux/Makefile.am @@ -12,6 +12,6 @@ libgtop_sysdeps_la_SOURCES = init.c 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 + procsegment.c siglist.c include_HEADERS = glibtop_server.h glibtop_machine.h diff --git a/sysdeps/linux/siglist.c b/sysdeps/linux/siglist.c new file mode 100644 index 00000000..92b9d275 --- /dev/null +++ b/sysdeps/linux/siglist.c @@ -0,0 +1,58 @@ +/* $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. */ + +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", NULL }, /* Hangup (POSIX). */ + { 2, "SIGINT", NULL }, /* Interrupt (ANSI). */ + { 3, "SIGQUIT", NULL }, /* Quit (POSIX). */ + { 4, "SIGILL", NULL }, /* Illegal instruction (ANSI). */ + { 5, "SIGTRAP", NULL }, /* Trace trap (POSIX). */ + { 6, "SIGABRT", NULL }, /* Abort (ANSI). */ + { 7, "SIGBUS", NULL }, /* BUS error (4.2 BSD). */ + { 8, "SIGFPE", NULL }, /* Floating-point exception (ANSI). */ + { 9, "SIGKILL", NULL }, /* Kill, unblockable (POSIX). */ + { 10, "SIGUSR1", NULL }, /* User-defined signal 1 (POSIX). */ + { 11, "SIGSEGV", NULL }, /* Segmentation violation (ANSI). */ + { 12, "SIGUSR2", NULL }, /* User-defined signal 2 (POSIX). */ + { 13, "SIGPIPE", NULL }, /* Broken pipe (POSIX). */ + { 14, "SIGALRM", NULL }, /* Alarm clock (POSIX). */ + { 15, "SIGTERM", NULL }, /* Termination (ANSI). */ + { 16, "SIGSTKFLT", NULL }, /* ??? */ + { 17, "SIGCHLD", NULL }, /* Child status has changed (POSIX). */ + { 18, "SIGCONT", NULL }, /* Continue (POSIX). */ + { 19, "SIGSTOP", NULL }, /* Stop, unblockable (POSIX). */ + { 20, "SIGTSTP", NULL }, /* Keyboard stop (POSIX). */ + { 21, "SIGTTIN", NULL }, /* Background read from tty (POSIX). */ + { 22, "SIGTTOU", NULL }, /* Background write to tty (POSIX). */ + { 23, "SIGURG", NULL }, /* Urgent condition on socket (4.2 BSD). */ + { 24, "SIGXCPU", NULL }, /* CPU limit exceeded (4.2 BSD). */ + { 25, "SIGXFSZ", NULL }, /* File size limit exceeded (4.2 BSD). */ + { 26, "SIGVTALRM", NULL }, /* Virtual alarm clock (4.2 BSD). */ + { 27, "SIGPROF", NULL }, /* Profiling alarm clock (4.2 BSD). */ + { 28, "SIGWINCH", NULL }, /* Window size change (4.3 BSD, Sun). */ + { 29, "SIGIO", NULL }, /* I/O now possible (4.2 BSD). */ + { 30, "SIGPWR", NULL }, /* Power failure restart (System V). */ + { 31, "SIGUNUSED", NULL }, + { 0, NULL, NULL }, +}; diff --git a/sysdeps/osf1/Makefile.am b/sysdeps/osf1/Makefile.am index 71623907..0092b03d 100644 --- a/sysdeps/osf1/Makefile.am +++ b/sysdeps/osf1/Makefile.am @@ -8,7 +8,7 @@ CFLAGS = -Wall -W @CFLAGS@ lib_LTLIBRARIES = libgtop_sysdeps.la libgtop_sysdeps_suid.la -libgtop_sysdeps_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ +libgtop_sysdeps_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c libgtop_sysdeps_la_LIBADD = -lmach diff --git a/sysdeps/osf1/siglist.c b/sysdeps/osf1/siglist.c new file mode 100644 index 00000000..440006ab --- /dev/null +++ b/sysdeps/osf1/siglist.c @@ -0,0 +1,58 @@ +/* $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. */ + +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", N_("Hangup") }, + { 2, "SIGINT", N_("Interrupt") }, + { 3, "SIGQUIT", N_("Quit") }, + { 4, "SIGILL", N_("Illegal instruction") }, + { 5, "SIGTRAP", N_("Trace trap") }, + { 6, "SIGABRT", N_("Abort") }, + { 7, "SIGEMT", N_("EMT error") }, + { 8, "SIGFPE", N_("Floating-point exception") }, + { 9, "SIGKILL", N_("Kill") }, + { 10, "SIGBUS", N_("Bus error") }, + { 11, "SIGSEGV", N_("Segmentation violation") }, + { 12, "SIGSYS", N_("Bad argument to system call") }, + { 13, "SIGPIPE", N_("Broken pipe") }, + { 14, "SIGALRM", N_("Alarm clock") }, + { 15, "SIGTERM", N_("Termination") }, + { 16, "SIGURG", N_("Urgent condition on socket") }, + { 17, "SIGSTOP", N_("Stop") }, + { 18, "SIGTSTP", N_("Keyboard stop") }, + { 19, "SIGCONT", N_("Continue") }, + { 20, "SIGCHLD", N_("Child status has changed") }, + { 21, "SIGTTIN", N_("Background read from tty") }, + { 22, "SIGTTOU", N_("Background write to tty") }, + { 23, "SIGIO", N_("I/O now possible") }, + { 24, "SIGXCPU", N_("CPU limit exceeded") }, + { 25, "SIGXFSZ", N_("File size limit exceeded") }, + { 26, "SIGVTALRM", N_("Virtual alarm clock") }, + { 27, "SIGPROF", N_("Profiling alarm clock") }, + { 28, "SIGWINCH", N_("Window size change") }, + { 29, "SIGINFO", N_("Information request") }, + { 30, "SIGUSR1", N_("User defined signal 1") }, + { 31, "SIGUSR2", N_("User defined signal 2") }, + { 0, NULL, NULL }, +}; diff --git a/sysdeps/stub/Makefile.am b/sysdeps/stub/Makefile.am index cb8a7e0b..63a02d25 100644 --- a/sysdeps/stub/Makefile.am +++ b/sysdeps/stub/Makefile.am @@ -8,7 +8,7 @@ CFLAGS = -Wall -W @CFLAGS@ lib_LTLIBRARIES = libgtop_sysdeps.la -libgtop_sysdeps_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ +libgtop_sysdeps_la_SOURCES = open.c close.c siglist.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 \ diff --git a/sysdeps/stub/siglist.c b/sysdeps/stub/siglist.c new file mode 100644 index 00000000..a4afb9bb --- /dev/null +++ b/sysdeps/stub/siglist.c @@ -0,0 +1,26 @@ +/* $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. */ + +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 0, NULL, NULL } }; diff --git a/sysdeps/sun4/Makefile.am b/sysdeps/sun4/Makefile.am index 09e3e6f6..7cb1ecd2 100644 --- a/sysdeps/sun4/Makefile.am +++ b/sysdeps/sun4/Makefile.am @@ -8,7 +8,7 @@ CFLAGS = -Wall -W @CFLAGS@ lib_LTLIBRARIES = libgtop_sysdeps.la libgtop_sysdeps_suid.la -libgtop_sysdeps_la_SOURCES = nosuid.c +libgtop_sysdeps_la_SOURCES = nosuid.c siglist.c libgtop_sysdeps_la_LIBADD = -lkvm libgtop_sysdeps_suid_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ diff --git a/sysdeps/sun4/siglist.c b/sysdeps/sun4/siglist.c new file mode 100644 index 00000000..440006ab --- /dev/null +++ b/sysdeps/sun4/siglist.c @@ -0,0 +1,58 @@ +/* $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. */ + +#include +#include + +const glibtop_signame glibtop_sys_siglist [] = +{ { 1, "SIGHUP", N_("Hangup") }, + { 2, "SIGINT", N_("Interrupt") }, + { 3, "SIGQUIT", N_("Quit") }, + { 4, "SIGILL", N_("Illegal instruction") }, + { 5, "SIGTRAP", N_("Trace trap") }, + { 6, "SIGABRT", N_("Abort") }, + { 7, "SIGEMT", N_("EMT error") }, + { 8, "SIGFPE", N_("Floating-point exception") }, + { 9, "SIGKILL", N_("Kill") }, + { 10, "SIGBUS", N_("Bus error") }, + { 11, "SIGSEGV", N_("Segmentation violation") }, + { 12, "SIGSYS", N_("Bad argument to system call") }, + { 13, "SIGPIPE", N_("Broken pipe") }, + { 14, "SIGALRM", N_("Alarm clock") }, + { 15, "SIGTERM", N_("Termination") }, + { 16, "SIGURG", N_("Urgent condition on socket") }, + { 17, "SIGSTOP", N_("Stop") }, + { 18, "SIGTSTP", N_("Keyboard stop") }, + { 19, "SIGCONT", N_("Continue") }, + { 20, "SIGCHLD", N_("Child status has changed") }, + { 21, "SIGTTIN", N_("Background read from tty") }, + { 22, "SIGTTOU", N_("Background write to tty") }, + { 23, "SIGIO", N_("I/O now possible") }, + { 24, "SIGXCPU", N_("CPU limit exceeded") }, + { 25, "SIGXFSZ", N_("File size limit exceeded") }, + { 26, "SIGVTALRM", N_("Virtual alarm clock") }, + { 27, "SIGPROF", N_("Profiling alarm clock") }, + { 28, "SIGWINCH", N_("Window size change") }, + { 29, "SIGINFO", N_("Information request") }, + { 30, "SIGUSR1", N_("User defined signal 1") }, + { 31, "SIGUSR2", N_("User defined signal 2") }, + { 0, NULL, NULL }, +};