From 5cfc0bb7233b77cf84c360d37641a34811e28f88 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 18 Apr 2015 20:08:47 +0200 Subject: [PATCH] (Linux) Implement frontend_linux_get_os - still needs major/minor set --- frontend/drivers/platform_linux.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/drivers/platform_linux.c b/frontend/drivers/platform_linux.c index e2a6985005..d1f74d92a1 100644 --- a/frontend/drivers/platform_linux.c +++ b/frontend/drivers/platform_linux.c @@ -27,6 +27,7 @@ #include #include #include +#include static const char *proc_apm_path = "/proc/apm"; static const char *proc_acpi_battery_path = "/proc/acpi/battery"; @@ -401,6 +402,16 @@ enum frontend_architecture frontend_linux_get_architecture(void) return FRONTEND_ARCH_NONE; } +static void frontend_linux_get_os(char *name, size_t sizeof_name, int *major, int *minor) +{ + struct utsname buffer; + + if (uname(&buffer) != 0) + return; + + strlcpy(name, buffer.release, sizeof_name); +} + const frontend_ctx_driver_t frontend_ctx_linux = { NULL, /* environment_get */ NULL, /* init */ @@ -411,7 +422,7 @@ const frontend_ctx_driver_t frontend_ctx_linux = { NULL, /* set_fork */ NULL, /* shutdown */ NULL, /* get_name */ - NULL, /* get_os */ + frontend_linux_get_os, NULL, /* get_rating */ NULL, /* load_content */ frontend_linux_get_architecture,