minix/minix/lib/libsys/kernel_call.c
Cristiano Giuffrida 9e6b1315c3 kernel: Allow kernel calls to return ENOTREADY.
This is required to avoid races with safecopy() at live update time.

Change-Id: I1f3e22d40f22d94bd2b850915f9b8163a08b5616
2015-09-16 11:02:31 +00:00

23 lines
358 B
C

#define _SYSTEM 1
#include <lib.h>
#include <minix/syslib.h>
#include <minix/sysutil.h>
int _kernel_call(int syscallnr, message *msgptr)
{
int t, r;
t = 1;
while(1) {
msgptr->m_type = syscallnr;
do_kernel_call(msgptr);
r = msgptr->m_type;
if(r != ENOTREADY) {
break;
}
tickdelay(t++);
}
return r;
}