Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-process/top-apple/files: top-apple-73-darwin9.patch
Date: Thu, 03 May 2012 13:23:33
Message-Id: 20120503132241.ABFF02004C@flycatcher.gentoo.org
1 grobian 12/05/03 13:22:41
2
3 Added: top-apple-73-darwin9.patch
4 Log:
5 Initial ebuild of Apple's version of top from Mac OS X Lion, patched to compile on older versions as well.
6
7 (Portage version: 2.2.01.20366-prefix/cvs/SunOS i386)
8
9 Revision Changes Path
10 1.1 sys-process/top-apple/files/top-apple-73-darwin9.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/top-apple/files/top-apple-73-darwin9.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/top-apple/files/top-apple-73-darwin9.patch?rev=1.1&content-type=text/plain
14
15 Index: top-apple-73-darwin9.patch
16 ===================================================================
17 --- libtop.c.orig 2012-05-03 14:35:48.000000000 +0200
18 +++ libtop.c 2012-05-03 14:41:36.000000000 +0200
19 @@ -23,6 +23,7 @@
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <limits.h>
23 +#include <inttypes.h>
24 #include <sys/types.h>
25 #include <mach/bootstrap.h>
26 #include <mach/host_priv.h>
27 @@ -1458,6 +1459,7 @@
28 libtop_pinfo_update_kernmem_info(task_t task, libtop_pinfo_t* pinfo) {
29 kern_return_t kr;
30
31 +#ifdef TASK_KERNELMEMORY_INFO_COUNT
32 mach_msg_type_number_t count = TASK_KERNELMEMORY_INFO_COUNT;
33
34 pinfo->psamp.p_palloc = pinfo->psamp.palloc;
35 @@ -1466,6 +1468,9 @@
36 pinfo->psamp.p_sfree = pinfo->psamp.sfree;
37
38 kr = task_info(task, TASK_KERNELMEMORY_INFO, (task_info_t)&pinfo->psamp.palloc, &count);
39 +#else
40 + memset(&pinfo->psamp.palloc, 0, sizeof(pinfo->psamp.palloc));
41 +#endif
42 return kr;
43 }
44
45 @@ -1630,9 +1635,11 @@
46 }
47
48 switch (info.share_mode) {
49 +#ifdef SM_LARGE_PAGE
50 case SM_LARGE_PAGE:
51 // Treat SM_LARGE_PAGE the same as SM_PRIVATE
52 // since they are not shareable and are wired.
53 +#endif
54 case SM_PRIVATE:
55 rprvt += info.private_pages_resident * pagesize;
56 rprvt += info.shared_pages_resident * pagesize;