2010-09-14 23:50:05 +02:00
|
|
|
|
2013-11-03 22:33:44 +01:00
|
|
|
#include "syslib.h"
|
2013-10-28 22:30:41 +01:00
|
|
|
|
2013-11-03 22:33:44 +01:00
|
|
|
#include <string.h>
|
2010-09-14 23:50:05 +02:00
|
|
|
#include <minix/sysinfo.h>
|
|
|
|
#include <minix/com.h>
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int getsysinfo(
|
2011-12-11 22:30:35 +01:00
|
|
|
endpoint_t who, /* from whom to request info */
|
|
|
|
int what, /* what information is requested */
|
|
|
|
void *where, /* where to put it */
|
|
|
|
size_t size /* how big it should be */
|
|
|
|
)
|
2010-09-14 23:50:05 +02:00
|
|
|
{
|
|
|
|
message m;
|
2013-10-28 22:30:41 +01:00
|
|
|
int call_nr;
|
|
|
|
|
|
|
|
switch (who) {
|
|
|
|
case PM_PROC_NR: call_nr = PM_GETSYSINFO; break;
|
|
|
|
case VFS_PROC_NR: call_nr = VFS_GETSYSINFO; break;
|
|
|
|
case RS_PROC_NR: call_nr = RS_GETSYSINFO; break;
|
|
|
|
case DS_PROC_NR: call_nr = DS_GETSYSINFO; break;
|
|
|
|
default:
|
|
|
|
return ENOSYS;
|
|
|
|
}
|
|
|
|
|
2013-11-03 22:33:44 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
2010-09-14 23:50:05 +02:00
|
|
|
m.SI_WHAT = what;
|
|
|
|
m.SI_WHERE = where;
|
2011-12-11 22:30:35 +01:00
|
|
|
m.SI_SIZE = size;
|
2013-10-28 22:30:41 +01:00
|
|
|
return _taskcall(who, call_nr, &m);
|
2010-09-14 23:50:05 +02:00
|
|
|
}
|