selinux_getenforcemode(3)

selinux_getenforcemode3

Get the enforcing state of selinux

Usage

#include <selinux/selinux.h>

int selinux_getenforcemode(int *enforce);

Overview

selinux_getenforcemode() Reads the contents of the /etc/selinux/config file to determine how the system was setup to run SELinux.

Sets the value of enforce to 1 if SELinux should be run in enforcing mode. Sets the value of enforce to 0 if SELinux should be run in permissive mode. Sets the value of enforce to -1 if SELinux should be disabled.

Return value

On success, zero is returned. On failure, -1 is returned.

Releases

11 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1–4.0
  2. 5.0–7
  3. 8–13

From libselinux1-dev 3.8.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.