auparse_flush_feed - Man Page

flush any unconsumed feed data through parser.

Synopsis

#include <auparse.h>

int auparse_flush_feed(auparse_state_t *au);"

Description

auparse_flush_feed should be called to signal the end of feed input data and flush any pending parse data through the parsing system. auparse_add_callback() must be called before flushing feed data so that complete events have a consumer. Malformed feed records are rejected and are not passed to the callback. If malformed records are found, parsing continues for the rest of the available feed data before auparse_flush_feed returns an error.

Return Value

Returns -1 if an error occurs; otherwise, 0 for success. When -1 is returned, errno is set to indicate the error. The value of errno is meaningful only after an error return; callers should not assume it is cleared after a successful call. Applications that may run with libauparse from before audit-4.1.5 should set errno to 0 before calling auparse_flush_feed. If auparse_flush_feed returns -1 and errno is still 0, the runtime library is using the older error behavior and did not set errno. Clearing errno first avoids treating a pre-existing value as if it were set by auparse_flush_feed.

Errors

EINVAL

The parser state is invalid, the parser was not initialized with AUSOURCE_FEED, or no callback has been registered.

ENOMEM

Memory allocation failed while parsing feed data.

EBADMSG

A malformed feed record was found. The malformed record was rejected and was not passed to the callback. Parsing continues for the rest of the available feed data before this error is returned.

EIO

An internal parser failure occurred without a more specific error code.

See Also

auparse_feed(3), auparse_feed_age_events(3), auparse_feed_has_data(3)

Author

John Dennis

Referenced By

auparse_add_callback(3), auparse_feed(3), auparse_feed_age_events(3).

Apr 2016 Red Hat Linux Audit API