kernel_release.c 406 B

1234567891011121314151617181920212223
  1. /* See LICENSE file for copyright and license details. */
  2. #include <sys/utsname.h>
  3. #include <stdio.h>
  4. #include <err.h>
  5. #include "../lib/util.h"
  6. void
  7. kernel_release(char *out,
  8. const char __unused *_a,
  9. uint32_t __unused _i,
  10. void __unused *_p)
  11. {
  12. struct utsname udata;
  13. if (uname(&udata) < 0) {
  14. warn("uname");
  15. ERRRET(out);
  16. }
  17. bprintf(out, "%s", udata.release);
  18. }