diff options
Diffstat (limited to 'src/shared/specifier.c')
-rw-r--r-- | src/shared/specifier.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/specifier.c b/src/shared/specifier.c index 7577c91052..bb8859fdfd 100644 --- a/src/shared/specifier.c +++ b/src/shared/specifier.c @@ -20,6 +20,7 @@ ***/ #include <string.h> +#include <sys/utsname.h> #include "macro.h" #include "util.h" @@ -145,3 +146,14 @@ char *specifier_boot_id(char specifier, void *data, void *userdata) { char *specifier_host_name(char specifier, void *data, void *userdata) { return gethostname_malloc(); } + +char *specifier_kernel_release(char specifier, void *data, void *userdata) { + struct utsname uts; + int r; + + r = uname(&uts); + if (r < 0) + return NULL; + + return strdup(uts.release); +} |