2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

libapparmor: Move over the lib functions needed by cache loading code

The function names must be prepended with "_aa_" since they're going to
be exported from libapparmor. The code bases using the _aa_autofree(),
_aa_autoclose(), and _aa_autofclose() will need to internally alias
those functions to the previously used autofree, autoclose, and
autofclose names.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Tyler Hicks
2015-03-25 17:09:27 -05:00
parent 6b200b6f08
commit deec20512b
8 changed files with 182 additions and 149 deletions

View File

@@ -1,14 +1,11 @@
#ifndef __AA_LIB_H_
#define __AA_LIB_H_
#include <dirent.h>
#include <sys/apparmor_private.h>
#define autofree __attribute((cleanup(__autofree)))
#define autoclose __attribute((cleanup(__autoclose)))
#define autofclose __attribute((cleanup(__autofclose)))
void __autofree(void *p);
void __autoclose(int *fd);
void __autofclose(FILE **f);
#define autofree __attribute((cleanup(_aa_autofree)))
#define autoclose __attribute((cleanup(_aa_autoclose)))
#define autofclose __attribute((cleanup(_aa_autofclose)))
void atomic_inc(unsigned int *v);
bool atomic_dec_and_test(unsigned int *v);