etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libc / sys / minix_rs.c
blob71b73603b431c4a773892a7a39ffa7f8da29a103
1 #define _SYSTEM 1
2 #define _MINIX_SYSTEM 1
4 #include <sys/cdefs.h>
6 #include <minix/com.h>
7 #include <minix/config.h>
8 #include <minix/ipc.h>
9 #include <minix/endpoint.h>
10 #include <minix/sysutil.h>
11 #include <minix/syslib.h>
12 #include <minix/const.h>
13 #include <minix/type.h>
14 #include <minix/ds.h>
15 #include <minix/rs.h>
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <errno.h>
20 #include <string.h>
21 #include <lib.h>
23 int minix_rs_lookup(const char *name, endpoint_t *value)
25 message m;
26 size_t len_key;
28 len_key = strlen(name)+1;
30 memset(&m, 0, sizeof(m));
31 m.m_rs_req.name = name;
32 m.m_rs_req.name_len = len_key;
34 if (_syscall(RS_PROC_NR, RS_LOOKUP, &m) != -1) {
35 *value = m.m_rs_req.endpoint;
36 return OK;
39 return -1;