minix/lib/libc/other/_vm_query_exit.c
Ben Gras d477a9ed82 vm/ipc: only report signals when it matters to ipc
. ipc wants to know about processes that get
	  signals, so that it can break blocking ipc operations
	. doing it for every single signal is wasteful
	  and causes the annoying 'no slot for signals' message
	. this fix tells vm on a per-process basis it (ipc)
	  wants to be notified, i.e. only when it does any ipc calls
	. move ipc config to separate config file while we're at it
2011-08-05 20:52:32 +00:00

35 lines
760 B
C

#define _SYSTEM 1
#include <lib.h>
#define vm_query_exit _vm_query_exit
#include <unistd.h>
/* return -1, when the query itself or the processing of query has errors.
* return 1, when there are more processes waiting to be queried.
* return 0, when there are no more processes.
* note that for the return value of 0 and 1, the 'endpt' is set accordingly.
*/
PUBLIC int vm_query_exit(int *endpt)
{
message m;
int r;
r = _syscall(VM_PROC_NR, VM_QUERY_EXIT, &m);
if (r != OK)
return -1;
if (endpt == NULL)
return -1;
*endpt = m.VM_QUERY_RET_PT;
return (m.VM_QUERY_IS_MORE ? 1 : 0);
}
PUBLIC int vm_watch_exit(endpoint_t ep)
{
message m;
int r;
memset(&m, 0, sizeof(m));
m.VM_WE_EP = ep;
return _syscall(VM_PROC_NR, VM_WATCH_EXIT, &m);
}