]> granicus.if.org Git - strace/blob - print_dev_t.c
tests: add ioctl_evdev-success* test binaries to .gitignore
[strace] / print_dev_t.c
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
10 #include "defs.h"
11 #include <sys/sysmacros.h>
12
13 void
14 print_dev_t(const unsigned long long dev)
15 {
16         if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
17                 tprintf("%#llx", dev);
18
19         if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
20                 return;
21
22         if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
23                 tprints(" /* ");
24
25         tprintf("makedev(%#x, %#x)", major(dev), minor(dev));
26
27         if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
28                 tprints(" */");
29 }