Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / lib / libsys / vm_info.c
blob81342487eeaa69894d87da08c64d15bfbf77fca8
2 #include "syslib.h"
4 #include <string.h>
5 #include <minix/vm.h>
7 /*===========================================================================*
8 * vm_info_stats *
9 *===========================================================================*/
10 int vm_info_stats(struct vm_stats_info *vsi)
12 message m;
14 memset(&m, 0, sizeof(m));
15 m.m_lsys_vm_info.what = VMIW_STATS;
16 m.m_lsys_vm_info.ptr = vsi;
18 return _taskcall(VM_PROC_NR, VM_INFO, &m);
21 /*===========================================================================*
22 * vm_info_usage *
23 *===========================================================================*/
24 int vm_info_usage(endpoint_t who, struct vm_usage_info *vui)
26 message m;
28 memset(&m, 0, sizeof(m));
29 m.m_lsys_vm_info.what = VMIW_USAGE;
30 m.m_lsys_vm_info.ep = who;
31 m.m_lsys_vm_info.ptr = vui;
33 return _taskcall(VM_PROC_NR, VM_INFO, &m);
36 /*===========================================================================*
37 * vm_info_region *
38 *===========================================================================*/
39 int vm_info_region(endpoint_t who, struct vm_region_info *vri,
40 int count, vir_bytes *next)
42 message m;
43 int result;
45 memset(&m, 0, sizeof(m));
46 m.m_lsys_vm_info.what = VMIW_REGION;
47 m.m_lsys_vm_info.ep = who;
48 m.m_lsys_vm_info.count = count;
49 m.m_lsys_vm_info.ptr = vri;
50 m.m_lsys_vm_info.next = *next;
52 if ((result = _taskcall(VM_PROC_NR, VM_INFO, &m)) != OK)
53 return result;
55 *next = m.m_lsys_vm_info.next;
56 return m.m_lsys_vm_info.count;