summaryrefslogtreecommitdiff
path: root/src/shared/tomoyo-util.c
blob: 99e0385e09107024d5f2fc26f595524c85a837f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* SPDX-License-Identifier: LGPL-2.1+ */
/***
  Copyright © 2017 Shawn Landden
***/

#include <unistd.h>

#include "tomoyo-util.h"

bool mac_tomoyo_use(void) {
        static int cached_use = -1;

        if (cached_use < 0)
                cached_use = (access("/sys/kernel/security/tomoyo/version",
                                     F_OK) == 0);

        return cached_use;
}