xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/sysevent/tst.post.c (revision 3490:c2cc0536565d)
1*3490Seschrock /*
2*3490Seschrock  * CDDL HEADER START
3*3490Seschrock  *
4*3490Seschrock  * The contents of this file are subject to the terms of the
5*3490Seschrock  * Common Development and Distribution License (the "License").
6*3490Seschrock  * You may not use this file except in compliance with the License.
7*3490Seschrock  *
8*3490Seschrock  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3490Seschrock  * or http://www.opensolaris.org/os/licensing.
10*3490Seschrock  * See the License for the specific language governing permissions
11*3490Seschrock  * and limitations under the License.
12*3490Seschrock  *
13*3490Seschrock  * When distributing Covered Code, include this CDDL HEADER in each
14*3490Seschrock  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3490Seschrock  * If applicable, add the following below this CDDL HEADER, with the
16*3490Seschrock  * fields enclosed by brackets "[]" replaced with your own identifying
17*3490Seschrock  * information: Portions Copyright [yyyy] [name of copyright owner]
18*3490Seschrock  *
19*3490Seschrock  * CDDL HEADER END
20*3490Seschrock  */
21*3490Seschrock /*
22*3490Seschrock  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*3490Seschrock  * Use is subject to license terms.
24*3490Seschrock  */
25*3490Seschrock 
26*3490Seschrock #pragma ident	"%Z%%M%	%I%	%E% SMI"
27*3490Seschrock 
28*3490Seschrock #include <libsysevent.h>
29*3490Seschrock #include <stdio.h>
30*3490Seschrock 
31*3490Seschrock int
main(int argc,char ** argv)32*3490Seschrock main(int argc, char **argv)
33*3490Seschrock {
34*3490Seschrock 	sysevent_id_t id;
35*3490Seschrock 
36*3490Seschrock 	for (;;) {
37*3490Seschrock 		if (sysevent_post_event("class_dtest", "subclass_dtest",
38*3490Seschrock 		    "vendor_dtest", "publisher_dtest", NULL, &id) != 0) {
39*3490Seschrock 			(void) fprintf(stderr, "failed to post sysevent\n");
40*3490Seschrock 			return (1);
41*3490Seschrock 		}
42*3490Seschrock 
43*3490Seschrock 		sleep(1);
44*3490Seschrock 	}
45*3490Seschrock }
46