1
2 #include "syslib.h"
3
4 #include <string.h>
5 #include <minix/sysinfo.h>
6 #include <minix/com.h>
7
getsysinfo(endpoint_t who,int what,void * where,size_t size)8 int getsysinfo(
9 endpoint_t who, /* from whom to request info */
10 int what, /* what information is requested */
11 void *where, /* where to put it */
12 size_t size /* how big it should be */
13 )
14 {
15 message m;
16 int call_nr;
17
18 switch (who) {
19 case PM_PROC_NR: call_nr = PM_GETSYSINFO; break;
20 case VFS_PROC_NR: call_nr = VFS_GETSYSINFO; break;
21 case RS_PROC_NR: call_nr = RS_GETSYSINFO; break;
22 case DS_PROC_NR: call_nr = DS_GETSYSINFO; break;
23 default:
24 return ENOSYS;
25 }
26
27 memset(&m, 0, sizeof(m));
28 m.m_lsys_getsysinfo.what = what;
29 m.m_lsys_getsysinfo.where = (vir_bytes)where;
30 m.m_lsys_getsysinfo.size = size;
31 return _taskcall(who, call_nr, &m);
32 }
33