Xinqi Bao's Git

Update LICENSE for Quentin
[slstatus.git] / components / kernel_release.c
1 /* See LICENSE file for copyright and license details. */
2 #include <errno.h>
3 #include <sys/utsname.h>
4 #include <stdio.h>
5 #include <string.h>
6
7 #include "../util.h"
8
9 const char *
10 kernel_release(void)
11 {
12 struct utsname udata;
13
14 if (uname(&udata) < 0) {
15 warn("uname:");
16 return NULL;
17 }
18
19 return bprintf("%s", udata.release);
20 }