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

# selinux\_set\_policy\_root(3)

return the path of the SELinux policy files for this machine selinux\_set\_policy\_root - Set an alternate SELinux root path for the SELinux policy files for this machine.

Part of [selinux\_policy\_root(3)](/selinux_policy_root/3.md).

## NAME

selinux\_policy\_root - return the path of the SELinux policy files for this machine selinux\_set\_policy\_root - Set an alternate SELinux root path for the SELinux policy files for this machine.

## SYNOPSIS

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

**const char \*selinux\_policy\_root(void);**

**int selinux\_set\_policy\_root(const char \*policypath);**

## DESCRIPTION

**selinux\_policy\_root**() reads the contents of the */etc/selinux/config* file to determine which policy files should be used for this machine. **selinux\_set\_policy\_root**() sets up all policy paths based on the alternate root

*/etc/selinux/config* file to determine which policy files should be used for this machine.

## RETURN VALUE

On success, selinux\_policy\_root returns a directory path containing the SELinux policy files. On failure, selinux\_policy\_root returns NULL.

On success, selinux\_set\_policy\_root returns 0 on success -1 on failure.

## SEE ALSO

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