selinux\_policy\_root(3) SELinux API documentation selinux\_policy\_root(3)

# [NAME](#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](#SYNOPSIS)

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

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

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

# [DESCRIPTION](#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](#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](#SEE_ALSO)

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

25 May 2004 dwalsh@redhat.com

---

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