list_autags(3AUDIT)
Name
list_autags - get a list of defined tag names
Synopsis
cc [ flag...] file ... -laudit [library ...]
#include <security/libaudit.h>
nvlist_t *list_autags(char *tags_fname);
Description
The list_autags() function returns an
nvlist containing information about names of all the audit
tags which are defined. All nvpairs in the returned
nvlist are of the same name ("tagname"),
and the values are all string type.
tags_fname specifies the tags file name to be used.
If NULL is specified then the default system audit tags are
used.
Return Values
Upon successful completion, an nvlist is allocated
and the address is returned. Otherwise, NULL is returned if
no tags are found or if an error occurs. If an error occurs,
errno is set to indicate the error.
The caller must call the nvlist_free() function to
deallocate the returned nvlist. For more information, see the
nvlist_free(3NVPAIR)
man page.
Errors
The list_autags() function will fail if:
- ENOENT
-
The specified tags file is not found or is not a regular file.
- EACCES
-
The specified tags file is not accessible.
- EINVAL
-
An error occurred while parsing the tags file(s).
Examples
Example 1 Get all tag names defined in default system tag files
#include <security/libaudit.h>
int error;
nvlist_t *list;
nvpair_t *pair = NULL;
char *tagname;
.
.
.
list = list_autags(NULL);
if (list == NULL) {
perror("list_autags");
exit(1);
}
while (pair = nvlist_next_nvpair(list, pair)) {
error = nvpair_value_string(pair, &tagname);
.
.
.
}
nvlist_free(list);
Attributes
See attributes(7) for descriptions of the following attributes:
|
|
Interface Stability |
Uncommitted |
MT-Level |
MT-Safe |
|
See Also
audit_tags(5),
libnvpair(3LIB),
attributes(7)
History
The list_autags() function was added
in Oracle Solaris 11.4.0.