2011-02-17 18:11:09 +01:00
|
|
|
#define _SYSTEM 1
|
2014-03-05 12:21:55 +01:00
|
|
|
#define _MINIX_SYSTEM 1
|
2013-02-25 12:43:15 +01:00
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
2011-02-17 18:11:09 +01:00
|
|
|
|
|
|
|
#include <minix/com.h>
|
|
|
|
#include <minix/config.h>
|
|
|
|
#include <minix/ipc.h>
|
|
|
|
#include <minix/endpoint.h>
|
|
|
|
#include <minix/sysutil.h>
|
|
|
|
#include <minix/syslib.h>
|
|
|
|
#include <minix/const.h>
|
|
|
|
#include <minix/type.h>
|
|
|
|
#include <minix/ds.h>
|
|
|
|
#include <minix/rs.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <lib.h>
|
|
|
|
|
|
|
|
int minix_rs_lookup(const char *name, endpoint_t *value)
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
size_t len_key;
|
|
|
|
|
|
|
|
len_key = strlen(name)+1;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
2014-07-26 13:54:01 +02:00
|
|
|
m.m_rs_req.name = name;
|
|
|
|
m.m_rs_req.name_len = len_key;
|
2011-02-17 18:11:09 +01:00
|
|
|
|
|
|
|
if (_syscall(RS_PROC_NR, RS_LOOKUP, &m) != -1) {
|
2014-07-26 13:54:01 +02:00
|
|
|
*value = m.m_rs_req.endpoint;
|
2011-02-17 18:11:09 +01:00
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|