strace/print_dev_t.c
Dmitry V. Levin b93d52fe3d Change the license of strace to LGPL-2.1-or-later
strace is now provided under the terms of the GNU Lesser General
Public License version 2.1 or later, see COPYING for more details.

strace test suite is now provided under the terms of the GNU General
Public License version 2 or later, see tests/COPYING for more details.
2018-12-10 00:00:00 +00:00

30 lines
615 B
C

/*
* Device number printing routine.
*
* Copyright (c) 2016 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include <sys/sysmacros.h>
void
print_dev_t(const unsigned long long dev)
{
if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
tprintf("%#llx", dev);
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
return;
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
tprints(" /* ");
tprintf("makedev(%#x, %#x)", major(dev), minor(dev));
if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
tprints(" */");
}