security_check_context - check the validity of a SELinux context
#include <selinux/selinux.h> int security_check_context(security_context_t con);
security_check_context returns 0 if SELinux is running and the context is valid, otherwise it returns -1.
selinux(8)