Ejemplo n.º 1
0
static evchan_t *
bind_channel(boolean_t priv, fmev_pri_t pri)
{
	evchan_t **evcpp = &CHAN_BINDING(priv, pri);
	evchan_t *evc;

	if (*evcpp != NULL)
		return (*evcpp);

	if (sysevent_evc_bind(CHAN_NAME(priv, pri), &evc,
	    EVCH_CREAT | CHAN_FLAGS(priv, pri)) != 0)
		return (NULL);

	if (atomic_cas_ptr(evcpp, NULL, evc) != NULL)
		(void) sysevent_evc_unbind(evc);

	return (*evcpp);
}
Ejemplo n.º 2
0
/*
 * fps_post_ereport(nvlist_t *ereport) posts an
 * ereport to the sysevent error channel.  The error
 * channel is assumed to be established by fps-transport.so.
 */
static int
fps_post_ereport(nvlist_t *ereport)
{
	evchan_t *scp;

	if (sysevent_evc_bind(CHANNEL, &scp, BIND_FLAGS) != 0) {
		return (1);
	}

	if (sysevent_evc_publish(scp, CLASS, SUBCLASS, VENDOR,
	    PUBLISHER, ereport, EVCH_NOSLEEP) != 0) {
		return (1);
	}

	(void) sleep(1);

	(void) fflush(NULL);
	(void) sysevent_evc_unbind(scp);

	return (0);
}
Ejemplo n.º 3
0
static void
sev_close(void *arg)
{
	sysevent_evc_unbind(arg);
}