Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

print_kernel_version.c 651B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Kernel version printing routine.
  3. *
  4. * Copyright (c) 2018 The strace developers.
  5. * All rights reserved.
  6. *
  7. * SPDX-License-Identifier: LGPL-2.1-or-later
  8. */
  9. #include "defs.h"
  10. void
  11. print_kernel_version(const unsigned long version)
  12. {
  13. if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
  14. tprintf("%#lx", version);
  15. if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
  16. return;
  17. if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
  18. tprints(" /* ");
  19. tprintf("KERNEL_VERSION(%lu, %lu, %lu)",
  20. version >> 16,
  21. (version >> 8) & 0xFF,
  22. version & 0xFF);
  23. if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
  24. tprints(" */");
  25. }