From 4a2817cea12bdb904443b17438d464491a0f8a20 Mon Sep 17 00:00:00 2001 From: Jorrit Herder Date: Fri, 17 Jun 2005 08:53:33 +0000 Subject: [PATCH] Changed uname to retrieve actual OS release and version number at runtime. --- lib/other/_svrctl.c | 1 + lib/posix/_uname.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/other/_svrctl.c b/lib/other/_svrctl.c index f48d49230..3a52d1674 100755 --- a/lib/other/_svrctl.c +++ b/lib/other/_svrctl.c @@ -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; } diff --git a/lib/posix/_uname.c b/lib/posix/_uname.c index 80803c3d0..9ad0cc489 100755 --- a/lib/posix/_uname.c +++ b/lib/posix/_uname.c @@ -16,11 +16,13 @@ #include #include #include +#include #include 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())); -- 2.44.0