FreeBSD/sys/security/audit/audit_pipe.c
/*
 * Determine whether there exists a pipe interested in a record with specific
 * properties.
 */
Determine whether there exists a pipe interested in a record with specific
properties.
Determine whether there exists a pipe interested in a record with specific properties .
int
audit_pipe_preselect(au_id_t auid, au_event_t event, au_class_t class,
    int sorf, int trail_preselect)
{
	struct audit_pipe *ap;
	if (TAILQ_EMPTY(&audit_pipe_list))
		return (0);
	AUDIT_PIPE_LIST_RLOCK();
	TAILQ_FOREACH(ap, &audit_pipe_list, ap_list) {
		AUDIT_PIPE_LOCK(ap);
		if (audit_pipe_preselect_check(ap, auid, event, class, sorf,
		    trail_preselect)) {
			AUDIT_PIPE_UNLOCK(ap);
			AUDIT_PIPE_LIST_RUNLOCK();
			return (1);
		}
		AUDIT_PIPE_UNLOCK(ap);
	}
	AUDIT_PIPE_LIST_RUNLOCK();
	return (0);
}
int audit_pipe_preselect ( au_id_t auid , au_event_t event , au_class_t class , int sorf , int trail_preselect ) { struct audit_pipe * ap ; if ( TAILQ_EMPTY ( & audit_pipe_list ) ) return ( 0 ) ; AUDIT_PIPE_LIST_RLOCK ( ) ; TAILQ_FOREACH ( ap , & audit_pipe_list , ap_list ) { AUDIT_PIPE_LOCK ( ap ) ; if ( audit_pipe_preselect_check ( ap , auid , event , class , sorf , trail_preselect ) ) { AUDIT_PIPE_UNLOCK ( ap ) ; AUDIT_PIPE_LIST_RUNLOCK ( ) ; return ( 1 ) ; } AUDIT_PIPE_UNLOCK ( ap ) ; } AUDIT_PIPE_LIST_RUNLOCK ( ) ; return ( 0 ) ; }
Determine whether there exists a pipe interested in a record with specific
 properties.
Determine whether there exists a pipe interested in a record with specific properties .
/* Lockless read to avoid acquiring the global lock if not needed. */