2011-02-17 18:11:09 +01:00
|
|
|
#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;
|
2013-11-01 13:34:14 +01:00
|
|
|
status = ipc_sendrec(who, msgptr);
|
2011-02-17 18:11:09 +01:00
|
|
|
if (status != 0) {
|
2013-11-01 13:34:14 +01:00
|
|
|
/* 'ipc_sendrec' itself failed. */
|
2011-02-17 18:11:09 +01:00
|
|
|
/* 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);
|
|
|
|
}
|