summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-manager.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
commit55944e5e40b1be2afc4855d8d2baf4b73d1876b5 (patch)
tree33f869f55a1b149e9b7c2b7e201867ca5dd52992 /src/udev/udev-manager.h
parentInitial commit. (diff)
downloadsystemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.tar.xz
systemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.zip
Adding upstream version 255.4.upstream/255.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/udev/udev-manager.h')
-rw-r--r--src/udev/udev-manager.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/udev/udev-manager.h b/src/udev/udev-manager.h
new file mode 100644
index 0000000..afbc67f
--- /dev/null
+++ b/src/udev/udev-manager.h
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#pragma once
+
+#include <stdbool.h>
+
+#include "sd-device.h"
+#include "sd-event.h"
+
+#include "hashmap.h"
+#include "macro.h"
+#include "time-util.h"
+#include "udev-ctrl.h"
+#include "udev-rules.h"
+
+typedef struct Event Event;
+typedef struct Worker Worker;
+
+typedef struct Manager {
+ sd_event *event;
+ Hashmap *workers;
+ LIST_HEAD(Event, events);
+ char *cgroup;
+ int log_level;
+
+ UdevRules *rules;
+ Hashmap *properties;
+
+ sd_device_monitor *monitor;
+ UdevCtrl *ctrl;
+ int worker_watch[2];
+
+ /* used by udev-watch */
+ int inotify_fd;
+ sd_event_source *inotify_event;
+
+ sd_event_source *kill_workers_event;
+
+ sd_event_source *memory_pressure_event_source;
+ sd_event_source *sigrtmin18_event_source;
+
+ usec_t last_usec;
+
+ ResolveNameTiming resolve_name_timing;
+ unsigned children_max;
+ usec_t exec_delay_usec;
+ usec_t timeout_usec;
+ int timeout_signal;
+ bool blockdev_read_only;
+
+ bool udev_node_needs_cleanup;
+ bool stop_exec_queue;
+ bool exit;
+} Manager;
+
+Manager* manager_new(void);
+Manager* manager_free(Manager *manager);
+DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
+
+int manager_init(Manager *manager, int fd_ctrl, int fd_uevent);
+int manager_main(Manager *manager);
+
+bool devpath_conflict(const char *a, const char *b);