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

# semanage\_set\_root(3)

SELinux Management API

## NAME

semanage\_set\_root, semanage\_root - SELinux Management API

## SYNOPSIS

Set/get the alternate root directory for SELinux configuration directory.

**#include \<semanage/handle.h\>**

**extern int semanage\_set\_root(const char \*path);**

**extern const char \*semanage\_root(void);**

## DESCRIPTION

- The function semanage\_set\_root() sets an alternate root directory for SELinux configuration paths to be used by the semanage library.

  ## RETURN VALUE

The function semanage\_set\_root() returns -1 in case of failure. Otherwise, 0 is returned.

The function semanage\_root() returns the semanage root. The returned value should not be modified by the caller.

## SEE ALSO

**semanage\_handle\_create**(3), **semanage\_connect**(3),
