diff options
author | wiz <wiz@pkgsrc.org> | 2001-07-17 10:48:06 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2001-07-17 10:48:06 +0000 |
commit | fdd133e4ec9b17709d2b897ce8d5f86e75de7426 (patch) | |
tree | 1df8b66f5c6e26908371faff43ea20115b7a3549 /devel | |
parent | 1860c8e900a82750920afaa95a7e6e714173017e (diff) | |
download | pkgsrc-fdd133e4ec9b17709d2b897ce8d5f86e75de7426.tar.gz |
Add patch to sysctl uptime out of kernel. Closes pkg/13046.
Diffstat (limited to 'devel')
-rw-r--r-- | devel/libgtop/distinfo | 3 | ||||
-rw-r--r-- | devel/libgtop/patches/patch-as | 38 |
2 files changed, 40 insertions, 1 deletions
diff --git a/devel/libgtop/distinfo b/devel/libgtop/distinfo index 0892894543e..230b468dded 100644 --- a/devel/libgtop/distinfo +++ b/devel/libgtop/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2001/04/21 00:44:27 wiz Exp $ +$NetBSD: distinfo,v 1.3 2001/07/17 10:48:06 wiz Exp $ SHA1 (libgtop-1.0.12.tar.gz) = 7ff6ae62b599db4bd51b54d4d549627eacfc8509 Size (libgtop-1.0.12.tar.gz) = 882461 bytes @@ -13,3 +13,4 @@ SHA1 (patch-ao) = 09cb66ba7ee9a7368ec1cd1d4bd40ea3f6637a31 SHA1 (patch-ap) = 07a83340eb9d6a36a3f5b2db33eb50c74fbc4777 SHA1 (patch-aq) = 93ebb47710f1c4cc70406a92503bdc4a5bfa50d2 SHA1 (patch-ar) = 0ab882d06c2b18dc0bee3e13fd2257b960a70c3a +SHA1 (patch-as) = 0374fc36c418871e929fbb3c53ab4979e780e8d5 diff --git a/devel/libgtop/patches/patch-as b/devel/libgtop/patches/patch-as new file mode 100644 index 00000000000..0979be7525c --- /dev/null +++ b/devel/libgtop/patches/patch-as @@ -0,0 +1,38 @@ +$NetBSD: patch-as,v 1.1 2001/07/17 10:48:06 wiz Exp $ + +--- sysdeps/freebsd/uptime.c.orig Thu May 27 16:04:16 1999 ++++ sysdeps/freebsd/uptime.c +@@ -49,6 +49,27 @@ + void + glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) + { ++#ifdef __NetBSD__ ++ time_t now; ++ time_t uptime; ++ int mib[2]; ++ struct timeval boottime; ++ size_t size; ++ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_BOOTTIME; ++ size = sizeof(boottime); ++ if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && ++ boottime.tv_sec != 0) { ++ time(&now); ++ buf->uptime = now - boottime.tv_sec; ++ /* XXX: don't know a useful value to put here. */ ++ buf->idletime = 0; ++ buf->flags = _glibtop_sysdeps_uptime; ++ } ++#else ++ buf->flags = _glibtop_sysdeps_uptime; ++ + glibtop_cpu cpu; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_UPTIME), 0); +@@ -70,4 +91,5 @@ + buf->idletime = (double) cpu.idle / (double) cpu.frequency; + + buf->flags = _glibtop_sysdeps_uptime; ++#endif + } |