etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libsys / vm_memctl.c
blob35d9b171e08a7ce5e39e7312b2a834b7ac93eb87
1 #include "syslib.h"
2 #include <unistd.h>
3 #include <string.h>
5 int
6 vm_memctl(endpoint_t ep, int req, void** addr, size_t *len)
8 message m;
9 int r;
11 memset(&m, 0, sizeof(m));
12 m.VM_RS_CTL_ENDPT = ep;
13 m.VM_RS_CTL_REQ = req;
14 m.VM_RS_CTL_ADDR = addr ? *addr : 0;
15 m.VM_RS_CTL_LEN = len ? *len : 0;
17 r = _taskcall(VM_PROC_NR, VM_RS_MEMCTL, &m);
18 if(r != OK) {
19 return r;
21 if(addr) {
22 *addr = m.VM_RS_CTL_ADDR;
24 if(len) {
25 *len = m.VM_RS_CTL_LEN;
28 return OK;