summaryrefslogtreecommitdiff
path: root/trans/proxy-defpager.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-16 01:48:40 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-16 01:48:40 +0100
commit4f51b0e104481fb6d337140eeaa51af8c674d236 (patch)
tree452aacaf7f586e2ccd22bda15a92419d9616065b /trans/proxy-defpager.c
parent0bc52ecb504401e089e1aa335c56e0c5db6d8e32 (diff)
Add getting swap information from swapon and procfs
* hurd/default_pager.defs (default_pager_storage_info): New RPC. * hurd/default_pager_reply.defs: Skip default_pager_storage_info RPC. * hurd/default_pager_types.h: Include <mach/machine/vm_types.h>. (vm_size_array_t): New type. * mach-defpager/priv.h (part): Add `name' field. * mach-defpager/default_pager.c (new_partition): Allocate and fill `part->name' field. Free it on error. (destroy_paging_partition): Free `part->name' field. (S_default_pager_storage_info): New function. * procfs/Makefile (SRCS): Add default_pagerUser.c. * procfs/rootdir.c: Include "default_pager_U.h". (rootdir_gc_swaps): New function. (rootdir_entries): Add "swaps" entry. * sutils/swapon.c: Include <argz.h> (show): New variable. (options): Add --show/-S option. (def_pager, dev_master): New variables (swaponoff): Move getting `def_pager' to... (get_def_pager): ... new function. (main): Support 'S' option. * trans/proxy-defpager.c (S_default_pager_storage_info): New function.
Diffstat (limited to 'trans/proxy-defpager.c')
-rw-r--r--trans/proxy-defpager.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/trans/proxy-defpager.c b/trans/proxy-defpager.c
index 4fdeb35b..9a8436ae 100644
--- a/trans/proxy-defpager.c
+++ b/trans/proxy-defpager.c
@@ -64,6 +64,19 @@ S_default_pager_info (mach_port_t default_pager, default_pager_info_t *info)
}
kern_return_t
+S_default_pager_storage_info (mach_port_t default_pager,
+ vm_size_array_t *size,
+ mach_msg_type_number_t *sizeCnt,
+ vm_size_array_t *free,
+ mach_msg_type_number_t *freeCnt,
+ data_t *name,
+ mach_msg_type_number_t *nameCnt)
+{
+ return allowed (default_pager, O_READ)
+ ?: default_pager_storage_info (real_defpager, size, sizeCnt, free, freeCnt, name, nameCnt);
+}
+
+kern_return_t
S_default_pager_objects (mach_port_t default_pager,
default_pager_object_array_t *objects,
mach_msg_type_number_t *objectsCnt,