kernel_release.c 327 B

1234567891011121314151617181920
  1. /* See LICENSE file for copyright and license details. */
  2. #include <stdio.h>
  3. #include <sys/utsname.h>
  4. #include "../slstatus.h"
  5. #include "../util.h"
  6. const char *
  7. kernel_release(const char *unused)
  8. {
  9. struct utsname udata;
  10. if (uname(&udata) < 0) {
  11. warn("uname:");
  12. return NULL;
  13. }
  14. return bprintf("%s", udata.release);
  15. }