FreeBSD/sys/i386/bios/apm.c
/*
 * return 0 if the user will notice and handle the event,
 * return 1 if the kernel driver should do so.
 */
return 0 if the user will notice and handle the event,
return 1 if the kernel driver should do so.
return 0 if the user will notice and handle the event return 1 if the kernel driver should do so .
static int
apm_record_event(struct apm_softc *sc, u_int event_type)
{
	struct apm_event_info *evp;
	if ((sc->sc_flags & SCFLAG_OPEN) == 0)
		return 1;		
	if (sc->event_count == APM_NEVENTS)
		return 1;			
	if (sc->event_filter[event_type] == 0)
		return 1;		
	evp = &sc->event_list[sc->event_ptr];
	sc->event_count++;
	sc->event_ptr++;
	sc->event_ptr %= APM_NEVENTS;
	evp->type = event_type;
	evp->index = ++apm_evindex;
	selwakeuppri(&sc->sc_rsel, PZERO);
	return (sc->sc_flags & SCFLAG_OCTL) ? 0 : 1; 
}
static int apm_record_event ( struct apm_softc * sc , u_int event_type ) { struct apm_event_info * evp ; if ( ( sc -> sc_flags & SCFLAG_OPEN ) == 0 ) return 1 ; if ( sc -> event_count == APM_NEVENTS ) return 1 ; if ( sc -> event_filter [ event_type ] == 0 ) return 1 ; evp = & sc -> event_list [ sc -> event_ptr ] ; sc -> event_count ++ ; sc -> event_ptr ++ ; sc -> event_ptr %= APM_NEVENTS ; evp -> type = event_type ; evp -> index = ++ apm_evindex ; selwakeuppri ( & sc -> sc_rsel , PZERO ) ; return ( sc -> sc_flags & SCFLAG_OCTL ) ? 0 : 1 ; }
return 0 if the user will notice and handle the event,
 return 1 if the kernel driver should do so.
return 0 if the user will notice and handle the event return 1 if the kernel driver should do so .
/* no user waiting */ /* overflow */ /* not registered */ /* user may handle */