From: Jorrit Herder Date: Fri, 17 Jun 2005 08:53:33 +0000 (+0000) Subject: Changed uname to retrieve actual OS release and version number at runtime. X-Git-Tag: v3.1.0~757 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-keygen.html?a=commitdiff_plain;h=4a2817cea12bdb904443b17438d464491a0f8a20;p=minix.git Changed uname to retrieve actual OS release and version number at runtime. --- 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()));