selinux_getpolicytype(3)

✨ selinux_getpolicytype(3) ✨

okay bestie, so this one lives in the SELinux API documentation and it's genuinely so useful, no cap πŸ’–


πŸŽ€ NAME πŸŽ€

selinux_getpolicytype β€” get the type of SELinux policy running on the system


🌸 SYNOPSIS 🌸

#include <selinux/selinux.h>

int selinux_getpolicytype(char **policytype);

πŸ¦‹ DESCRIPTION πŸ¦‹

selinux_getpolicytype() reads the contents of the /etc/selinux/config file to figure out which SELinux policy is being used on the system, and then sets policytype accordingly. like, it literally goes and peeks at the config file for you, slay πŸ’…

when you're done with it, free policytype with free(3). don't ghost it, bestie, free your memory 🫢


πŸ’€ RETURN VALUE πŸ’€

on success, zero is returned. on failure, -1 is returned. that's it, that's the vibe check 😭


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, periodt πŸ’– this icon was written by dwalsh@redhat.com back on 24 Sep 2008, and it's part of the selinux_getpolicytype(3) manual page β€” go off, king 🌈✨

πŸ“¦ where this page comes from