Changed uname to retrieve actual OS release and version number at runtime.

This commit is contained in:
Jorrit Herder 2005-06-17 08:53:33 +00:00
parent f673723b1f
commit 4a2817cea1
2 changed files with 7 additions and 2 deletions

View File

@ -22,6 +22,7 @@ int svrctl(int request, void *argp)
/* FS handles calls for itself and inet. */
return _syscall(FS, SVRCTL, &m);
default:
printf("Yups ...\n");
errno = EINVAL;
return -1;
}

View File

@ -16,11 +16,13 @@
#include <string.h>
#include <errno.h>
#include <minix/config.h>
#include <minix/com.h>
#include <minix/minlib.h>
int uname(name) struct utsname *name;
{
int hf, n, err;
struct kinfo kinfo;
char *nl;
/* 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);
}
}
getsysinfo(PM_PROC_NR, SI_KINFO, &kinfo);
strcpy(name->sysname, "Minix");
strcpy(name->release, OS_RELEASE);
strcpy(name->version, OS_VERSION);
strcpy(name->release, kinfo.release);
strcpy(name->version, kinfo.version);
#if (CHIP == INTEL)
name->machine[0] = 'i';
strcpy(name->machine + 1, itoa(getprocessor()));