minix/lib/other/_getsysinfo.c

34 lines
836 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
#include <lib.h>
#include <minix/endpoint.h>
2005-04-21 16:53:53 +02:00
#define getsysinfo _getsysinfo
#define getsysinfo_up _getsysinfo_up
#include <minix/sysinfo.h>
2005-04-21 16:53:53 +02:00
PUBLIC int getsysinfo(who, what, where)
endpoint_t who; /* from whom to request info */
2005-04-21 16:53:53 +02:00
int what; /* what information is requested */
void *where; /* where to put it */
{
message m;
m.m1_i1 = what;
m.m1_p1 = where;
if (_syscall(who, GETSYSINFO, &m) < 0) return(-1);
return(0);
}
/* Unprivileged variant of getsysinfo. */
PUBLIC ssize_t getsysinfo_up(who, what, size, where)
endpoint_t who; /* from whom to request info */
int what; /* what information is requested */
size_t size; /* input and output size */
void *where; /* where to put it */
{
message m;
m.SIU_WHAT = what;
m.SIU_WHERE = where;
m.SIU_LEN = size;
return _syscall(who, GETSYSINFO_UP, &m);
}