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]
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"
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
57 * Structures for building arbitarily long strings and argument lists
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);
101 #endif /* _SYSEVENTCONFD_H */