]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
1ca208fb ZJS |
2 | #pragma once |
3 | ||
ed435031 ZJS |
4 | #include "sd-device.h" |
5 | ||
a707c65b | 6 | #include "device-private.h" |
4b3ca79e ZJS |
7 | #include "time-util.h" |
8 | ||
c8eaaf69 YW |
9 | #define UDEV_NAME_SIZE 512 |
10 | #define UDEV_PATH_SIZE 1024 | |
11 | #define UDEV_LINE_SIZE 16384 | |
12 | ||
bc768f04 ZJS |
13 | typedef enum ResolveNameTiming { |
14 | RESOLVE_NAME_NEVER, | |
15 | RESOLVE_NAME_LATE, | |
16 | RESOLVE_NAME_EARLY, | |
17 | _RESOLVE_NAME_TIMING_MAX, | |
2d93c20e | 18 | _RESOLVE_NAME_TIMING_INVALID = -EINVAL, |
bc768f04 ZJS |
19 | } ResolveNameTiming; |
20 | ||
21 | ResolveNameTiming resolve_name_timing_from_string(const char *s) _pure_; | |
22 | const char *resolve_name_timing_to_string(ResolveNameTiming i) _const_; | |
23 | ||
4b3ca79e ZJS |
24 | int udev_parse_config_full( |
25 | unsigned *ret_children_max, | |
26 | usec_t *ret_exec_delay_usec, | |
a14e7af1 | 27 | usec_t *ret_event_timeout_usec, |
e2099267 MS |
28 | ResolveNameTiming *ret_resolve_name_timing, |
29 | int *ret_timeout_signal); | |
4b3ca79e ZJS |
30 | |
31 | static inline int udev_parse_config(void) { | |
e2099267 | 32 | return udev_parse_config_full(NULL, NULL, NULL, NULL, NULL); |
4b3ca79e | 33 | } |
ed435031 | 34 | |
9e3d9067 LP |
35 | int device_wait_for_initialization(sd_device *device, const char *subsystem, usec_t deadline, sd_device **ret); |
36 | int device_wait_for_devlink(const char *path, const char *subsystem, usec_t deadline, sd_device **ret); | |
90ba130f | 37 | int device_is_renaming(sd_device *dev); |
a707c65b | 38 | bool device_for_action(sd_device *dev, DeviceAction action); |
aea3253e | 39 | |
b2d9e58f YW |
40 | void log_device_uevent(sd_device *device, const char *str); |
41 | ||
aea3253e | 42 | int udev_rule_parse_value(char *str, char **ret_value, char **ret_endpos); |
5953d8b9 | 43 | size_t udev_replace_whitespace(const char *str, char *to, size_t len); |
393fcaf7 | 44 | size_t udev_replace_chars(char *str, const char *allow); |
1223227f | 45 | int udev_resolve_subsys_kernel(const char *string, char *result, size_t maxsize, bool read_value); |
bee33d05 YW |
46 | |
47 | int udev_queue_is_empty(void); | |
48 | int udev_queue_init(void); |