Esempio n. 1
0
/*
 * Extension SVC handler for log
 */
EXPORT ER __syslog_send( const char *string, int len )
{
	ER	ercd;

	if ( string == NULL ) {
		return svc_syslog_wait();
	}

	if ( len <= 0 ) {
		return E_OK;
	}

#if USE_SYSLOG_CONSIO
	if ( logtask_alive ) {
		/* When log task is running, send message to log task */
		if ( len > log_msg_maxmsz ) {
			len = log_msg_maxmsz;
		}
		ercd = tk_snd_mbf(log_mbfid, (VP)string, len, TMO_POL);
		if ( ercd != E_OK ) {
			logtask_alive = 0;
		}
	}
#endif

	if ( !logtask_alive ) {
		/* When it is not running, use low level character
		   output routine directly. */
		sys_write(string, len);
		sys_write("\n", 1);
	}

	return E_OK;
}
Esempio n. 2
0
/*
 * event notification
 */
EXPORT ER kpNotifyEvent( void *evt, W size )
{
	ER	ercd;

        /* unnecessary to notify event if message buffer for event notification is unspecified */
	if ( kpMgrInfo.eventMbf == InvalidID ) return E_OK;

        /* event notification */
	ercd = tk_snd_mbf(kpMgrInfo.eventMbf, evt, size, TMO_FEVR);
	if ( ercd != E_OK ) {
		DEBUG_PRINT(("kpNotifyEvent, tk_snd_mbf err = %d\n", ercd));
		return ercd;
	}

	return E_OK;
}
Esempio n. 3
0
/*
 *	Event notification
 */
EXPORT	void	sdSendEvt(DrvTab *drv, W kind)
{
	W	i;
	DiskEvt	evt;
	ER	er;

	evt.h.evttyp = (kind == TDE_EJECT && drv->OpenCnt != 0) ?
			TDE_ILLEJECT : kind;
	evt.h.devid = drv->DevId;

	/* Set the subunit's open status to "info" */
	evt.info = 0;
	for (i = 0; i <= drv->nSUnit; i++) {
		if (drv->s.SUnit[i].OpenCnt > 0) evt.info |= 1 << i;
	}

	/* Send to the message buffer for event notification:ignore error */
	er = tk_snd_mbf(drv->MbfId, (void*)&evt, sizeof(evt), TMO_EVENT);
}