minix/lib/libc/sys-minix/syscall.c
Lionel Sambuc fe3b8cf035 3.3.0j Squashed for testing purposes
Change-Id: Ic32d886158c29b23f322eb777894be3f9b438caf
2013-11-19 18:18:58 +01:00

26 lines
504 B
C

#include <sys/cdefs.h>
#include <lib.h>
#include "namespace.h"
#ifdef __weak_alias
__weak_alias(syscall, _syscall)
#endif
int _syscall(endpoint_t who, int syscallnr, message *msgptr)
{
int status;
msgptr->m_type = syscallnr;
status = ipc_sendrec(who, msgptr);
if (status != 0) {
/* 'ipc_sendrec' itself failed. */
/* XXX - strerror doesn't know all the codes */
msgptr->m_type = status;
}
if (msgptr->m_type < 0) {
errno = -msgptr->m_type;
return(-1);
}
return(msgptr->m_type);
}