1 #include <sys/cdefs.h> 2 #include <lib.h> 3 #include "namespace.h" 4 5 #ifdef __weak_alias __weak_alias(syscall,_syscall)6__weak_alias(syscall, _syscall) 7 #endif 8 9 int _syscall(endpoint_t who, int syscallnr, message *msgptr) 10 { 11 int status; 12 13 msgptr->m_type = syscallnr; 14 status = ipc_sendrec(who, msgptr); 15 if (status != 0) { 16 /* 'ipc_sendrec' itself failed. */ 17 /* XXX - strerror doesn't know all the codes */ 18 msgptr->m_type = status; 19 } 20 if (msgptr->m_type < 0) { 21 errno = -msgptr->m_type; 22 return(-1); 23 } 24 return(msgptr->m_type); 25 } 26