summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-25 23:10:02 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-25 23:10:02 +0000
commitf095b8d906eca183030e15b4eadeb2276501fe6c (patch)
treee7b78ad3358c3978e65fb3c23e1bb264cc2e919f
parent775fd48eafe2bdc98aa00683b4079fa5cc4093e8 (diff)
parentdc2a7e0310f420dac56957d5e5b3deb906da3cc8 (diff)
Merge branch 'upstream-merged'
-rw-r--r--libmachdev/net.c4
-rw-r--r--procfs/rootdir.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/libmachdev/net.c b/libmachdev/net.c
index 4b4cfe7c..501c9bb7 100644
--- a/libmachdev/net.c
+++ b/libmachdev/net.c
@@ -583,10 +583,10 @@ device_set_status(void *d, dev_flavor_t flavor, dev_status_t status,
{
if (flavor == NET_FLAGS)
{
- if (count != sizeof(short))
+ if (count != 1)
return D_INVALID_SIZE;
- short flags = *(short *) status;
+ int flags = *(int *) status;
struct net_data *net = (struct net_data *) d;
dev_change_flags (net->dev, flags);
diff --git a/procfs/rootdir.c b/procfs/rootdir.c
index 1fa71b03..31e2d8c6 100644
--- a/procfs/rootdir.c
+++ b/procfs/rootdir.c
@@ -17,8 +17,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <mach/gnumach.h>
#include <mach/vm_param.h>
#include <mach/vm_statistics.h>
+#include <mach/vm_cache_statistics.h>
#include <mach/default_pager.h>
#include <hurd/paths.h>
#include <stdio.h>
@@ -263,6 +265,7 @@ rootdir_gc_meminfo (void *hook, char **contents, ssize_t *contents_len)
host_basic_info_data_t hbi;
mach_msg_type_number_t cnt;
struct vm_statistics vmstats;
+ struct vm_cache_statistics cache_stats;
default_pager_info_t swap;
error_t err;
@@ -270,6 +273,10 @@ rootdir_gc_meminfo (void *hook, char **contents, ssize_t *contents_len)
if (err)
return EIO;
+ err = vm_cache_statistics (mach_task_self (), &cache_stats);
+ if (err)
+ return EIO;
+
cnt = HOST_BASIC_INFO_COUNT;
err = host_info (mach_host_self (), HOST_BASIC_INFO, (host_info_t) &hbi, &cnt);
if (err)
@@ -294,7 +301,7 @@ rootdir_gc_meminfo (void *hook, char **contents, ssize_t *contents_len)
(long unsigned) hbi.memory_size / 1024,
(long unsigned) vmstats.free_count * PAGE_SIZE / 1024,
0,
- 0,
+ (long unsigned) cache_stats.cache_count * PAGE_SIZE / 1024,
(long unsigned) vmstats.active_count * PAGE_SIZE / 1024,
(long unsigned) vmstats.inactive_count * PAGE_SIZE / 1024,
(long unsigned) vmstats.wire_count * PAGE_SIZE / 1024,