]> Zhao Yanbai Git Server - minix.git/commitdiff
Changed uname to retrieve actual OS release and version number at runtime.
authorJorrit Herder <jnherder@minix3.org>
Fri, 17 Jun 2005 08:53:33 +0000 (08:53 +0000)
committerJorrit Herder <jnherder@minix3.org>
Fri, 17 Jun 2005 08:53:33 +0000 (08:53 +0000)
lib/other/_svrctl.c
lib/posix/_uname.c

index f48d4923002d2d1973eb8ea9e57f5c6111dc5966..3a52d1674f64b95015b3610c25a7752b61d17009 100755 (executable)
@@ -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;
        }
index 80803c3d0d9695d3b85a19306095630c7011a793..9ad0cc489aa72d673b018f40f9032c541cc1281b 100755 (executable)
 #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()));