minix/lib/nbsd_libc/sys-minix/minix_rs.c
Thomas Veerman 92b61c816d Fix many more comiler warnings
Most warnings were harmless, some real bugs. Test set should now compile
cleanly with ack, gcc, and clang.
2011-11-28 10:07:55 +00:00

41 lines
743 B
C

#include <sys/cdefs.h>
#define _SYSTEM 1
#define _MINIX 1
#include <minix/ansi.h>
#include <minix/callnr.h>
#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;
m.RS_NAME = (char *) __UNCONST(name);
m.RS_NAME_LEN = len_key;
if (_syscall(RS_PROC_NR, RS_LOOKUP, &m) != -1) {
*value = m.RS_ENDPOINT;
return OK;
}
return -1;
}