is_selinux_enabled(3)
β¨ NAME β¨
okay so bestie, welcome to the SELinux API documentation corner of the man pages π today we're talking about is_selinux_enabled β the little function that checks whether SELinux is enabled π«Ά
is_selinux_enabledβ check whether SELinux is enabled
β¨ NAME β¨
and like, there's a second one too because of course there is π
is_selinux_mls_enabledβ check whether SELinux is enabled for (Multi Level Security) MLS
πΈ SYNOPSIS πΈ
here's the vibe, copy it exactly bestie:
#include <selinux/selinux.h>
int is_selinux_enabled(void);
int is_selinux_mls_enabled(void);
π¦ DESCRIPTION π¦
so is_selinux_enabled() is giving very simple main character energy: it returns 1 if SELinux is running, or 0 if it is not. that's it. that's the whole thing. periodt β¨
and is_selinux_mls_enabled()? it returns 1 if SELinux is capable of running in MLS mode, or 0 if it is not. no cap. π
lowkey important side quest: if you actually wanna figure out the policy in use on the system, use selinux_getpolicytype(3) instead π don't come for this function for that, it's not its job.
π SEE ALSO π
and that's a wrap, my love π this little page was brought to you by russell@coker.com.au, dated 7 Mar 2010, and it's the is_selinux_enabled(3) page from the SELinux API documentation β slay, go check your SELinux status bestie π
β¨
π¦ where this page comes from
- alpine 3.24: libselinux-doc 3.10-r1 Β· Public-Domain
- centos-stream 10: libselinux-devel 3.11-3.el10 Β· LicenseRef-Fedora-Public-Domain
- fedora 43: libselinux-devel 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 43: libselinux-devel 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- nixos 26.05: libselinux 3.10
- nixpkgs unstable: libselinux 3.11
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms