minix/lib/libc/other/syscall.c
Kees van Reeuwijk 36e12d5bd8 Use endpoint_t for the destination of mini_send and _syscall, and the
source of mini_receive.

Also some small cleanup.
2010-06-02 21:51:32 +00:00

20 lines
398 B
C

#include <lib.h>
PUBLIC int _syscall(endpoint_t who, int syscallnr, message *msgptr)
{
int status;
msgptr->m_type = syscallnr;
status = _sendrec(who, msgptr);
if (status != 0) {
/* '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);
}