dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / syseventd / daemons / syseventconfd / syseventconfd.h
blob6f95ea9404cdb518556057a341e5ac6d09858ddd
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYSEVENTCONFD_H
28 #define _SYSEVENTCONFD_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
38 * debug levels
40 #define DBG_EXEC 1 /* path and args for each fork/exec */
41 #define DBG_EVENTS 2 /* received events */
42 #define DBG_CHILD 3 /* child exit status */
43 #define DBG_EXEC_ARGS 4 /* more detail on exec args */
47 * list of cmds received from syseventd/sysevent_conf_mod
49 struct cmd {
50 nvlist_t *cmd_nvlist;
51 struct cmd *cmd_next;
52 struct cmd *cmd_taiL;
57 * Structures for building arbitarily long strings and argument lists
59 typedef struct arg {
60 char **arg_args;
61 int arg_nargs;
62 int arg_alloc;
63 int arg_hint;
64 } arg_t;
66 typedef struct str {
67 char *s_str;
68 int s_len;
69 int s_alloc;
70 int s_hint;
71 } str_t;
75 * Prototypes
77 static void event_handler(sysevent_t *event);
78 static void exec_cmd(struct cmd *cmd);
79 static void sigwait_thr(void);
80 static void reapchild(int sig);
81 static void flt_handler(int sig);
82 static void syserrmsg(char *message, ...);
83 static void printmsg(int level, char *message, ...);
84 static void set_root_dir(char *dir);
85 static void usage(void);
86 static arg_t *init_arglist(int hint);
87 static void free_arglist(arg_t *arglist);
88 static int add_arg(arg_t *arglist, char *arg);
89 static char *next_arg(char **cpp);
90 static struct cmd *alloc_cmd(nvlist_t *nvlist);
91 static void free_cmd(struct cmd *cmd);
92 static void *sc_malloc(size_t n);
93 static void *sc_realloc(void *p, size_t n);
94 static sysevent_handle_t *open_channel(void);
97 #ifdef __cplusplus
99 #endif
101 #endif /* _SYSEVENTCONFD_H */