Changed uname to retrieve actual OS release and version number at runtime.
This commit is contained in:
parent
f673723b1f
commit
4a2817cea1
@ -22,6 +22,7 @@ int svrctl(int request, void *argp)
|
|||||||
/* FS handles calls for itself and inet. */
|
/* FS handles calls for itself and inet. */
|
||||||
return _syscall(FS, SVRCTL, &m);
|
return _syscall(FS, SVRCTL, &m);
|
||||||
default:
|
default:
|
||||||
|
printf("Yups ...\n");
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,11 +16,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <minix/config.h>
|
#include <minix/config.h>
|
||||||
|
#include <minix/com.h>
|
||||||
#include <minix/minlib.h>
|
#include <minix/minlib.h>
|
||||||
|
|
||||||
int uname(name) struct utsname *name;
|
int uname(name) struct utsname *name;
|
||||||
{
|
{
|
||||||
int hf, n, err;
|
int hf, n, err;
|
||||||
|
struct kinfo kinfo;
|
||||||
char *nl;
|
char *nl;
|
||||||
|
|
||||||
/* Read the node name from /etc/hostname.file. */
|
/* Read the node name from /etc/hostname.file. */
|
||||||
@ -38,10 +40,12 @@ int uname(name) struct utsname *name;
|
|||||||
memset(nl, 0, (name->nodename + sizeof(name->nodename)) - nl);
|
memset(nl, 0, (name->nodename + sizeof(name->nodename)) - nl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getsysinfo(PM_PROC_NR, SI_KINFO, &kinfo);
|
||||||
|
|
||||||
strcpy(name->sysname, "Minix");
|
strcpy(name->sysname, "Minix");
|
||||||
strcpy(name->release, OS_RELEASE);
|
strcpy(name->release, kinfo.release);
|
||||||
strcpy(name->version, OS_VERSION);
|
strcpy(name->version, kinfo.version);
|
||||||
#if (CHIP == INTEL)
|
#if (CHIP == INTEL)
|
||||||
name->machine[0] = 'i';
|
name->machine[0] = 'i';
|
||||||
strcpy(name->machine + 1, itoa(getprocessor()));
|
strcpy(name->machine + 1, itoa(getprocessor()));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user