make vfs & filesystems use failable copying
[minix3.git] / lib / libsys / getsysinfo.c
bloba5a4fbc7d5b783883baa929930cbc272a3f0818e
2 #include "syslib.h"
4 #include <string.h>
5 #include <minix/sysinfo.h>
6 #include <minix/com.h>
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 */
15 message m;
16 int call_nr;
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;
27 memset(&m, 0, sizeof(m));
28 m.SI_WHAT = what;
29 m.SI_WHERE = where;
30 m.SI_SIZE = size;
31 return _taskcall(who, call_nr, &m);