+++ /dev/null
---- util-vserver-0.30.216-pre2926/src/vserver-stat.c 2010-12-02 16:30:12.000000000 +0100
-+++ util-vserver-0.30.216-pre2926.new/src/vserver-stat.c 2011-01-18 20:32:23.465389530 +0100
-@@ -309,6 +309,7 @@
- unsigned long long rss;
- char *endptr;
- size_t len;
-+ uint64_t stime_total, utime_total;
-
- if (vc_virt_stat(xid, &vstat) == -1) {
- perror("vc_virt_stat()");
-@@ -402,6 +403,24 @@
- return;
- }
-
-+ strcpy(filename, cgroup);
-+ strcpy(filename + cgroup_len, "/cpuacct.stat");
-+
-+ if ((fd = open(filename, O_RDONLY)) == -1) {
-+ perror("open(cpuacct.stat)");
-+ return;
-+ }
-+ if (read(fd, buf, sizeof(buf)) == -1) {
-+ perror("read(cpuacct.stat)");
-+ return;
-+ }
-+ close(fd);
-+
-+ if (sscanf(buf, "user %lu\nsystem %lu\n", &utime_total, &stime_total) != 2) {
-+ perror("sscanf(cpuacct.stat)");
-+ return;
-+ }
-+
- res = Vector_insert(vec, &xid, cmpData);
- res->xid = xid;
-
-@@ -409,18 +428,8 @@
- res->VmRSS_total = rss / 4096;
- res->start_time_oldest= getUptime() - vstat.uptime/1000000;
-
-- res->utime_total = 0;
-- res->stime_total = 0;
-- // XXX: arbitrary CPU limit.
-- for (cpu = 0; cpu < 1024; cpu++) {
-- sched.cpu_id = cpu;
-- sched.bucket_id = 0;
-- if (vc_sched_info(xid, &sched) == -1)
-- break;
--
-- res->utime_total += sched.user_msec;
-- res->stime_total += sched.sys_msec;
-- }
-+ res->utime_total = utime_total * 1000 / sysconf(_SC_CLK_TCK) /* USER_HZ */;
-+ res->stime_total = stime_total * 1000 / sysconf(_SC_CLK_TCK) /* USER_HZ */;
- }
-
- res->VmSize_total += process->VmSize;
-
%undefine with_doc
%endif
-%define snap pre2926
-%define rel 7
+%define snap pre2933
+%define rel 1
Summary: Linux virtual server utilities
Summary(pl.UTF-8): Narzędzia dla linuksowych serwerów wirtualnych
Name: util-vserver
License: GPL
Group: Applications/System
Source0: http://people.linux-vserver.org/~dhozac/t/uv-testing/%{name}-%{version}-%{snap}.tar.bz2
-# Source0-md5: 236c0ef54b94f8c116afaf7b78396a58
+# Source0-md5: 478a699a154c2823ad2606c50b5f55e4
Source1: vprocunhide.init
Source2: vservers.init
Source3: vservers-legacy.init
Patch22: %{name}-pivot-root-ugly-hack.patch
Patch24: vunify-more-exclude.patch
Patch25: stat.patch
-Patch26: %{name}-usersystime.patch
URL: http://savannah.nongnu.org/projects/util-vserver/
BuildRequires: autoconf
BuildRequires: automake >= 1.9
%patch22 -p1
%patch24 -p1
%patch25 -p1
-%patch26 -p1
install %{SOURCE9} package-management.txt