1 /*****************************************************************************\
3 * | || | ___ | |_ _ __ | | _ _ __ _ |_ ) *
4 * | __ |/ _ \| _|| '_ \| || || |/ _` | / / *
5 * |_||_|\___/ \__|| .__/|_| \_,_|\__, |/___| *
7 \*****************************************************************************/
14 * Various compatibility definitions.
16 #ifndef SO_RCVBUFFORCE
17 #if defined(__alpha__) || defined(__hppa__) || defined(__sparc__) || defined(__sparc_v9__)
18 #define SO_RCVBUFFORCE 0x100b
20 #define SO_RCVBUFFORCE 33
24 #ifndef SO_SNDBUFFORCE
25 #if defined(__alpha__) || defined(__hppa__) || defined(__sparc__) || defined(__sparc_v9__)
26 #define SO_SNDBUFFORCE 0x100a
28 #define SO_SNDBUFFORCE 32
32 #ifndef NETLINK_KOBJECT_UEVENT
33 #define NETLINK_KOBJECT_UEVENT 15
37 #define O_NOATIME 01000000
40 #define ERROR(action, fmt, arg...) fprintf(stderr, "[%s]: " fmt"\n", action, ##arg);
41 #define INFO(action, fmt, arg...) fprintf(stdout, "[%s]: " fmt"\n", action, ##arg);
43 #define DBG(action, fmt, arg...) fprintf(stdout, "[%s]: " fmt"\n", action, ##arg);
45 #define DBG(action, fmt, arg...)
48 #define HOTPLUG2_MSG_BACKLOG 64
49 #define UEVENT_BUFFER_SIZE 2048
50 #define HOTPLUG2_THROTTLE_INTERVAL 50
51 #define HOTPLUG2_RULE_PATH "/etc/hotplug2.rules"
54 #define ACTION_REMOVE 1
55 #define ACTION_UNKNOWN -1
57 #define UDEVTRIGGER_COMMAND "/sbin/udevtrigger", "/sbin/udevtrigger"
61 #define FORK_FINISHED -2
63 #define event_seqnum_t unsigned long long
65 #define sysfs_seqnum_path "/sys/kernel/uevent_seqnum"
72 struct hotplug2_event_t
{
74 event_seqnum_t seqnum
;
75 struct env_var_t
*env_vars
;
79 struct hotplug2_event_t
*next
;
87 char *get_hotplug2_value_by_key(struct hotplug2_event_t
*, char *);
89 #endif /* ifndef HOTPLUG2_H */