libutil: add O_NOCTTY back to old pty open code
[minix.git] / lib / libc / sys-minix / minix_rs.c
blob6b3f3e9d2b55ea04123c1c5d9b449a234fdd46e0
1 #include <sys/cdefs.h>
2 #define _SYSTEM 1
3 #define _MINIX 1
5 #include <minix/callnr.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 m.RS_NAME = (char *) __UNCONST(name);
31 m.RS_NAME_LEN = len_key;
33 if (_syscall(RS_PROC_NR, RS_LOOKUP, &m) != -1) {
34 *value = m.RS_ENDPOINT;
35 return OK;
38 return -1;