/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <libsysevent.h>
#include <inj.h>
#include <inj_err.h>
#include <inj_string.h>
int verbose;
int quiet;
static int
usage(void)
{
"\t-c specify alternate channel to use for publication\n"
"\t-n compile program but do not inject any events\n"
"\t-q enable quiet mode (silence status messages)\n"
"\t-v enable verbose output (display event details)\n",
getpname());
return (E_USAGE);
}
/*
* Sysevent-based event delivery
*/
static void *
{
EVCH_CREAT | EVCH_HOLD_PEND)) != 0)
return (hdl);
}
static void
{
warn("failed to send event");
}
static void
{
(void) sysevent_evc_unbind(arg);
}
};
/*
* Simulated delivery
*/
/*ARGSUSED*/
static void *
{
return ((void *)1);
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static void
{
}
};
int
{
int c;
const char *file;
switch (c) {
case 'c':
return (usage());
mode = &sysevent_ops;
break;
case 'n':
return (usage());
mode = &simulate_ops;
break;
case 'q':
quiet = 1;
break;
case 'v':
verbose = 1;
break;
default:
return (usage());
}
}
mode = &sysevent_ops;
if (argc == 0)
file = "-";
else if (argc == 1)
else
return (usage());
else
return (0);
}