selinux\_getpolicytype(3) SELinux API documentation selinux\_getpolicytype(3)

# [NAME](#NAME)

selinux\_getpolicytype - get the type of SELinux policy running on the system

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;selinux/selinux.h&gt;**

**int selinux\_getpolicytype(char \*\*policytype);**

# [DESCRIPTION](#DESCRIPTION)

**selinux\_getpolicytype**() Reads the contents of the */etc/selinux/config* file to determine the SELinux policy used on the system, and sets *policytype* accordingly. Free *policytype* with [**free**(3)](/man/os/libselinux/free.3).

# [RETURN VALUE](#RETURN_VALUE)

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

# [SEE ALSO](#SEE_ALSO)

[**selinux**(8)](/man/os/libselinux/selinux.8)

24 Sep 2008 dwalsh@redhat.com

---

Document: selinux_getpolicytype(3) from libselinux 3.11-r2 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
