2 * Copyright (C) 2004 Ling, Xiaofeng <xiaofeng.ling@intel.com>
3 * Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
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.
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.
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.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #define UDEVD_PRIORITY -4
23 #define UDEV_PRIORITY -2
25 #define EVENT_QUEUE_DIR ".udev/queue"
26 #define EVENT_FAILED_DIR ".udev/failed"
27 #define EVENT_SEQNUM ".udev/uevent_seqnum"
29 /* maximum limit of forked childs */
30 #define UDEVD_MAX_CHILDS 256
31 /* start to throttle forking if maximum number of running childs in our session is reached */
32 #define UDEVD_MAX_CHILDS_RUNNING 16
34 /* linux/include/linux/kobject.h */
35 #define UEVENT_BUFFER_SIZE 2048
36 #define UEVENT_NUM_ENVP 32
38 #define UDEVD_CTRL_SOCK_PATH "/org/kernel/udev/udevd"
39 #define UDEVD_CTRL_MAGIC "udevd_" UDEV_VERSION
41 enum udevd_ctrl_msg_type
{
43 UDEVD_CTRL_STOP_EXEC_QUEUE
,
44 UDEVD_CTRL_START_EXEC_QUEUE
,
45 UDEVD_CTRL_SET_LOG_LEVEL
,
46 UDEVD_CTRL_SET_MAX_CHILDS
,
47 UDEVD_CTRL_SET_MAX_CHILDS_RUNNING
,
48 UDEVD_CTRL_RELOAD_RULES
,
52 struct udevd_ctrl_msg
{
54 enum udevd_ctrl_msg_type type
;
58 struct udevd_uevent_msg
{
59 struct list_head node
;
68 unsigned long long seqnum
;
71 char *envp
[UEVENT_NUM_ENVP
+1];