From 33d349dcbbef0952e9e59ca105e08fdff5454803 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 5 Sep 2008 15:42:39 +0300 Subject: include build and runtime host information in debug output --- src/pulsecore/core-util.c | 8 ++++++++ src/pulsecore/core-util.h | 1 + 2 files changed, 9 insertions(+) (limited to 'src/pulsecore') diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index ad00f4f4..3e5ea492 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef HAVE_STRTOF_L #include @@ -2445,5 +2446,12 @@ char *pa_machine_id(void) { /* If no hostname was set we use the POSIX hostid. It's usually * the IPv4 address. Mit not be that stable. */ return pa_sprintf_malloc("%08lx", (unsigned long) gethostid); +} + +char *pa_uname_string(void) { + struct utsname u; + + pa_assert_se(uname(&u) == 0); + return pa_sprintf_malloc("%s %s %s %s", u.sysname, u.machine, u.release, u.version); } diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h index c9e307f5..df8ce3f8 100644 --- a/src/pulsecore/core-util.h +++ b/src/pulsecore/core-util.h @@ -191,5 +191,6 @@ pa_bool_t pa_in_system_mode(void); #define pa_streq(a,b) (!strcmp((a),(b))) char *pa_machine_id(void); +char *pa_uname_string(void); #endif -- cgit