minix/lib/libminlib/svrctl.c
David van Moolenbroek 44d3230e40 For common calls, give servers unique call numbers
The getsysinfo(2), getrusage(2), and svrctl(2) calls used the same
call number to different services. Since we want to give each service
its own call number ranges, this is no longer tenable. This patch
introduces per-service call numbers for these calls.

Note that the remainder of the COMMON_ range is left intact, as these
the remaining requests in it are processed by SEF and thus server-
agnostic. The range should really be prefixed with SEF_ now.

Change-Id: I80d728bbeb98227359c525494c433965b40fefc3
2014-03-01 09:05:00 +01:00

29 lines
561 B
C

/* svrctl() - special server control functions. Author: Kees J. Bot
* 24 Apr 1994
*/
#include <lib.h>
#include <stdio.h>
#include <sys/svrctl.h>
int svrctl(int request, void *argp)
{
message m;
m.m2_i1 = request;
m.m2_p1 = argp;
switch ((request >> 8) & 0xFF) {
case 'M':
case 'S':
/* PM handles calls for itself and the kernel. */
return _syscall(PM_PROC_NR, PM_SVRCTL, &m);
case 'F':
case 'I':
/* VFS handles calls for itself and inet. */
return _syscall(VFS_PROC_NR, VFS_SVRCTL, &m);
default:
errno = EINVAL;
return -1;
}
}