---
name: "selinux_getpolicytype"
section: "3"
platform: "linux"
package: "libselinux1-dev"
version: "3.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/selinux_getpolicytype"
---

# selinux\_getpolicytype(3)

get the type of SELinux policy running on the system

## NAME

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

## SYNOPSIS

**#include \<selinux/selinux.h\>**

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

## 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)](/free/3.md).

## RETURN VALUE

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

## SEE ALSO

[**selinux**(8)](/selinux/8.md)
