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

# security\_check\_context(3)

check the validity of a SELinux context

## NAME

security\_check\_context - check the validity of a SELinux context

## SYNOPSIS

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

**int security\_check\_context(const char \****con***);**

**int security\_check\_context\_raw(const char \****con***);**

## DESCRIPTION

**security\_check\_context**() returns 0 if SELinux is running and the context is valid, otherwise it returns -1.

**security\_check\_context\_raw**() behaves identically to **security\_check\_context**() but does not perform context translation.

## SEE ALSO

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