retire BIOS_SEG and umap_bios
[minix3.git] / lib / libc / sys-minix / syscall.c
blob522810835ba4228bdeca67c17c8a624aec512752
1 #include <sys/cdefs.h>
2 #include <lib.h>
3 #include "namespace.h"
5 #ifdef __weak_alias
6 __weak_alias(syscall, _syscall)
7 #endif
9 int _syscall(endpoint_t who, int syscallnr, message *msgptr)
11 int status;
13 msgptr->m_type = syscallnr;
14 status = _sendrec(who, msgptr);
15 if (status != 0) {
16 /* 'sendrec' itself failed. */
17 /* XXX - strerror doesn't know all the codes */
18 msgptr->m_type = status;
20 if (msgptr->m_type < 0) {
21 errno = -msgptr->m_type;
22 return(-1);
24 return(msgptr->m_type);