]> git.ipfire.org Git - thirdparty/systemd.git/blame - udevd.h
volume_id: fix Makefile for parallel make
[thirdparty/systemd.git] / udevd.h
CommitLineData
7fafc032 1/*
7fafc032 2 * Copyright (C) 2004 Ling, Xiaofeng <xiaofeng.ling@intel.com>
27b77df4 3 * Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
7fafc032
KS
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
27b77df4 16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
7fafc032
KS
17 *
18 */
19
a695feae 20#include "list.h"
33db4b8d 21
085cce37
KS
22#define UDEVD_PRIORITY -4
23#define UDEV_PRIORITY -2
24
fc55cf68
KS
25#define EVENT_QUEUE_DIR ".udev/queue"
26#define EVENT_FAILED_DIR ".udev/failed"
7baada47 27#define EVENT_SEQNUM ".udev/uevent_seqnum"
fc55cf68 28
1aa1e248 29/* maximum limit of forked childs */
b879c303 30#define UDEVD_MAX_CHILDS 256
085cce37 31/* start to throttle forking if maximum number of running childs in our session is reached */
fc465079 32#define UDEVD_MAX_CHILDS_RUNNING 16
085cce37 33
b3518c16 34/* linux/include/linux/kobject.h */
7d1e179f 35#define UEVENT_BUFFER_SIZE 2048
b3518c16 36#define UEVENT_NUM_ENVP 32
7fafc032 37
b3518c16
KS
38#define UDEVD_CTRL_SOCK_PATH "/org/kernel/udev/udevd"
39#define UDEVD_CTRL_MAGIC "udevd_" UDEV_VERSION
4a231017 40
b3518c16
KS
41enum udevd_ctrl_msg_type {
42 UDEVD_CTRL_UNKNOWN,
43 UDEVD_CTRL_STOP_EXEC_QUEUE,
44 UDEVD_CTRL_START_EXEC_QUEUE,
45 UDEVD_CTRL_SET_LOG_LEVEL,
46 UDEVD_CTRL_SET_MAX_CHILDS,
f051e340 47 UDEVD_CTRL_SET_MAX_CHILDS_RUNNING,
b3518c16 48 UDEVD_CTRL_RELOAD_RULES,
1343a952 49 UDEVD_CTRL_ENV,
b3518c16 50};
3b47c739 51
b3518c16 52struct udevd_ctrl_msg {
3b47c739 53 char magic[32];
b3518c16
KS
54 enum udevd_ctrl_msg_type type;
55 char buf[256];
3b47c739
KS
56};
57
b3518c16 58struct udevd_uevent_msg {
f8a178a3 59 struct list_head node;
35b7d88c 60 pid_t pid;
f4fc0136 61 int exitstatus;
0b3dfb3d 62 time_t queue_time;
4a231017
KS
63 char *action;
64 char *devpath;
65 char *subsystem;
254efc14 66 char *driver;
ebfc1acd 67 dev_t devt;
4a231017 68 unsigned long long seqnum;
79721e0a 69 char *physdevpath;
7f7ae03a 70 unsigned int timeout;
3b47c739 71 char *envp[UEVENT_NUM_ENVP+1];
4a231017 72 char envbuf[];
7fafc032 73};