diff options
author | Benoît Dejean <bdejean@src.gnome.org> | 2007-06-25 17:30:40 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2007-06-25 17:30:40 +0000 |
commit | ef34cfb38aa2870a454a4e5a76d3d3c1a9e8f701 (patch) | |
tree | b1f4d753e12a2ed55690d429f824272082c67843 /sysdeps/linux | |
parent | 1e0ba1d7aa39c0c33c158073edcdd6bd90a002dd (diff) | |
download | libgtop-ef34cfb38aa2870a454a4e5a76d3d3c1a9e8f701.tar.gz |
git-svn sucks. Kill r2609
svn path=/trunk/; revision=2611
Diffstat (limited to 'sysdeps/linux')
-rw-r--r-- | sysdeps/linux/Makefile.am | 3 | ||||
-rw-r--r-- | sysdeps/linux/glibtop_server.h | 1 | ||||
-rw-r--r-- | sysdeps/linux/procaffinity.c | 69 |
3 files changed, 1 insertions, 72 deletions
diff --git a/sysdeps/linux/Makefile.am b/sysdeps/linux/Makefile.am index 09114d75..6b94337b 100644 --- a/sysdeps/linux/Makefile.am +++ b/sysdeps/linux/Makefile.am @@ -8,8 +8,7 @@ libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ proctime.c procmem.c procsignal.c prockernel.c \ procsegment.c procargs.c procmap.c siglist.c \ sysinfo.c netload.c ppp.c glibtop_private.c \ - fsusage.c netlist.c procopenfiles.c procwd.c \ - procaffinity.c + fsusage.c netlist.c procopenfiles.c procwd.c libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@ diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 116547fe..3f9980d6 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -43,7 +43,6 @@ #define GLIBTOP_SUID_NETLOAD 0 #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PROC_WD 0 -#define GLIBTOP_SUID_PROC_AFFINITY 0 #define GLIBTOP_SUID_PPP 0 #define GLIBTOP_SUID_PROC_FILE 0 diff --git a/sysdeps/linux/procaffinity.c b/sysdeps/linux/procaffinity.c index 81b90674..e69de29b 100644 --- a/sysdeps/linux/procaffinity.c +++ b/sysdeps/linux/procaffinity.c @@ -1,69 +0,0 @@ -/* Copyright (C) 2007 Benoît Dejean - This file is part of LibGTop 2. - - 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/procaffinity.h> -#include <glibtop/error.h> - -#include <glibtop_private.h> - -#include <sched.h> - - -void -_glibtop_init_proc_affinity_s(glibtop *server) -{ - server->sysdeps.proc_affinity = - (1 << GLIBTOP_PROC_AFFINITY_NUMBER) | - (1 << GLIBTOP_PROC_AFFINITY_ALL); - -} - - -guint16 * -glibtop_get_proc_affinity_s(glibtop *server, glibtop_proc_affinity *buf, pid_t pid) -{ - cpu_set_t set; - size_t i; - GArray* cpus; - - memset(buf, 0, sizeof *buf); - - if (sched_getaffinity(pid, sizeof set, &set) == -1) { - glibtop_error_r(server, "sched_getaffinity failed"); - return NULL; - } - - cpus = g_array_new(FALSE, FALSE, sizeof(guint16)); - - for (i = 0; i < MIN(CPU_SETSIZE, (size_t)(server->ncpu + 1)); i++) { - if (CPU_ISSET(i, &set)) { - guint16 n = i; - g_array_append_val(cpus, n); - } - } - - buf->number = cpus->len; - buf->all = (cpus->len == (size_t)(server->ncpu + 1)); - buf->flags = (1 << GLIBTOP_PROC_AFFINITY_NUMBER) - | (1 << GLIBTOP_PROC_AFFINITY_ALL); - - return (guint16*) g_array_free(cpus, FALSE); -} - |