2011-03-22 14:47:35 +01:00
|
|
|
/* svrctl() - special server control functions. Author: Kees J. Bot
|
|
|
|
* 24 Apr 1994
|
|
|
|
*/
|
|
|
|
#include <lib.h>
|
|
|
|
#include <stdio.h>
|
2013-11-04 22:48:08 +01:00
|
|
|
#include <string.h>
|
2011-03-22 14:47:35 +01:00
|
|
|
#include <sys/svrctl.h>
|
|
|
|
|
|
|
|
int svrctl(int request, void *argp)
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.SVRCTL_REQ = request;
|
|
|
|
m.SVRCTL_ARG = argp;
|
2011-03-22 14:47:35 +01:00
|
|
|
|
|
|
|
switch ((request >> 8) & 0xFF) {
|
|
|
|
case 'M':
|
|
|
|
case 'S':
|
|
|
|
/* PM handles calls for itself and the kernel. */
|
2013-10-28 22:30:41 +01:00
|
|
|
return _syscall(PM_PROC_NR, PM_SVRCTL, &m);
|
2011-03-22 14:47:35 +01:00
|
|
|
case 'F':
|
|
|
|
case 'I':
|
|
|
|
/* VFS handles calls for itself and inet. */
|
2013-10-28 22:30:41 +01:00
|
|
|
return _syscall(VFS_PROC_NR, VFS_SVRCTL, &m);
|
2011-03-22 14:47:35 +01:00
|
|
|
default:
|
|
|
|
errno = EINVAL;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|