]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/device-nodes.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2012 Lennart Poettering
11 #include <sys/types.h>
14 #include "stdio-util.h"
16 int encode_devnode_name(const char *str
, char *str_enc
, size_t len
);
17 int whitelisted_char_for_devnode(char c
, const char *additional
);
19 #define DEV_NUM_PATH_MAX \
20 (STRLEN("/dev/block/") + DECIMAL_STR_MAX(dev_t) + 1 + DECIMAL_STR_MAX(dev_t))
21 #define xsprintf_dev_num_path(buf, type, devno) \
22 xsprintf(buf, "/dev/%s/%u:%u", type, major(devno), minor(devno))