summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/tools.c')
-rw-r--r--mdk-stage1/tools.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c
index ea8450cef..5b2128fe9 100644
--- a/mdk-stage1/tools.c
+++ b/mdk-stage1/tools.c
@@ -34,6 +34,7 @@
#include <sys/mount.h>
#include <sys/poll.h>
#include <errno.h>
+#include <sys/utsname.h>
#include "stage1.h"
#include "log.h"
#include "mount.h"
@@ -465,6 +466,16 @@ int string_array_length(char ** a)
return i;
}
+int kernel_version(void)
+{
+ struct utsname val;
+ if (uname(&val)) {
+ log_perror("uname failed");
+ return -1;
+ }
+ return charstar_to_int(val.release + 2);
+}
+
int scall_(int retval, char * msg, char * file, int line)
{
char tmp[5000];