]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/device-nodes.h
tree-wide: avoid some loaded terms
[thirdparty/systemd.git] / src / basic / device-nodes.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <stddef.h>
5 #include <sys/types.h>
6
7 #include "macro.h"
8 #include "stdio-util.h"
9
10 int encode_devnode_name(const char *str, char *str_enc, size_t len);
11 int allow_listed_char_for_devnode(char c, const char *additional);
12
13 #define DEV_NUM_PATH_MAX \
14 (STRLEN("/dev/block/") + DECIMAL_STR_MAX(dev_t) + 1 + DECIMAL_STR_MAX(dev_t))
15 #define xsprintf_dev_num_path(buf, type, devno) \
16 xsprintf(buf, "/dev/%s/%u:%u", type, major(devno), minor(devno))