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_dev_t.c 620B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Device number printing routine.
  3. *
  4. * Copyright (c) 2016-2018 The strace developers.
  5. * All rights reserved.
  6. *
  7. * SPDX-License-Identifier: LGPL-2.1-or-later
  8. */
  9. #include "defs.h"
  10. #include <sys/sysmacros.h>
  11. void
  12. print_dev_t(const unsigned long long dev)
  13. {
  14. if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
  15. tprintf("%#llx", dev);
  16. if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
  17. return;
  18. if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
  19. tprints(" /* ");
  20. tprintf("makedev(%#x, %#x)", major(dev), minor(dev));
  21. if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
  22. tprints(" */");
  23. }