hardware_caps: add boxarch field

This commit is contained in:
Stefan Seyfried
2016-01-22 19:02:33 +01:00
parent 42267080f9
commit db3ec7352e
6 changed files with 29 additions and 13 deletions

View File

@@ -2,24 +2,22 @@
* determine the capabilities of the hardware.
* part of libstb-hal
*
* (C) 2010-2012 Stefan Seyfried
* (C) 2010-2012,2016 Stefan Seyfried
*
* License: GPL v2 or later
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <hardware_caps.h>
#include <sys/utsname.h>
static int initialized = 0;
static hw_caps_t caps;
hw_caps_t *get_hwcaps(void)
{
struct utsname u;
if (initialized)
return &caps;
@@ -32,6 +30,10 @@ hw_caps_t *get_hwcaps(void)
caps.display_xres = 8;
strcpy(caps.boxvendor, "Generic");
strcpy(caps.boxname, "PC");
if (! uname(&u))
strncpy(caps.boxarch, u.machine, sizeof(caps.boxarch));
else
fprintf(stderr, "%s: uname() failed: %m\n", __func__);
return &caps;
}