more pid queries; PM field macros; vm stubs
[minix.git] / lib / other / _vm_query_exit.c
blobc6e85f17cccac090ee499fe5870f7e3b5e3de5d1
1 #define _SYSTEM 1
2 #include <lib.h>
3 #define vm_query_exit _vm_query_exit
4 #include <unistd.h>
6 /* return -1, when the query itself or the processing of query has errors.
7 * return 1, when there are more processes waiting to be queried.
8 * return 0, when there are no more processes.
9 * note that for the return value of 0 and 1, the 'endpt' is set accordingly.
11 PUBLIC int vm_query_exit(int *endpt)
13 message m;
14 int r;
16 r = _syscall(VM_PROC_NR, VM_QUERY_EXIT, &m);
17 if (r != OK)
18 return -1;
19 if (endpt == NULL)
20 return -1;
22 *endpt = m.VM_QUERY_RET_PT;
23 return (m.VM_QUERY_IS_MORE ? 1 : 0);