MCPcopy Create free account
hub / github.com/F-Stack/f-stack / audit_pipe_flush

Function audit_pipe_flush

freebsd/security/audit/audit_pipe.c:609–626  ·  view source on GitHub ↗

* Flush all records currently present in an audit pipe; assume mutex is held. */

Source from the content-addressed store, hash-verified

607 * Flush all records currently present in an audit pipe; assume mutex is held.
608 */
609static void
610audit_pipe_flush(struct audit_pipe *ap)
611{
612 struct audit_pipe_entry *ape;
613
614 AUDIT_PIPE_LOCK_ASSERT(ap);
615
616 while ((ape = TAILQ_FIRST(&ap->ap_queue)) != NULL) {
617 TAILQ_REMOVE(&ap->ap_queue, ape, ape_queue);
618 ap->ap_qbyteslen -= ape->ape_record_len;
619 audit_pipe_entry_free(ape);
620 ap->ap_qlen--;
621 }
622 ap->ap_qoffset = 0;
623
624 KASSERT(ap->ap_qlen == 0, ("audit_pipe_free: ap_qbyteslen"));
625 KASSERT(ap->ap_qbyteslen == 0, ("audit_pipe_flush: ap_qbyteslen"));
626}
627
628/*
629 * Free an audit pipe; this means freeing all preselection state and all

Callers 2

audit_pipe_freeFunction · 0.85
audit_pipe_ioctlFunction · 0.85

Calls 1

audit_pipe_entry_freeFunction · 0.85

Tested by

no test coverage detected