aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/sysdeps/ironclad/include/sys/mac.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/sysdeps/ironclad/include/sys/mac.h
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/sysdeps/ironclad/include/sys/mac.h')
-rw-r--r--lib/mlibc/sysdeps/ironclad/include/sys/mac.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/mlibc/sysdeps/ironclad/include/sys/mac.h b/lib/mlibc/sysdeps/ironclad/include/sys/mac.h
new file mode 100644
index 0000000..d4cf76d
--- /dev/null
+++ b/lib/mlibc/sysdeps/ironclad/include/sys/mac.h
@@ -0,0 +1,46 @@
+#ifndef _SYS_MAC_H
+#define _SYS_MAC_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MAC_CAP_SCHED 0b00000000001
+#define MAC_CAP_SPAWN 0b00000000010
+#define MAC_CAP_ENTROPY 0b00000000100
+#define MAC_CAP_SYS_MEM 0b00000001000
+#define MAC_CAP_USE_NET 0b00000010000
+#define MAC_CAP_SYS_NET 0b00000100000
+#define MAC_CAP_SYS_MNT 0b00001000000
+#define MAC_CAP_SYS_PWR 0b00010000000
+#define MAC_CAP_PTRACE 0b00100000000
+#define MAC_CAP_SETUID 0b01000000000
+#define MAC_CAP_SYS_MAC 0b10000000000
+#define MAC_CAP_CLOCK 0b100000000000
+#define MAC_CAP_SIGNALALL 0b1000000000000
+unsigned long get_mac_capabilities(void);
+int set_mac_capabilities(unsigned long request);
+
+#define MAC_PERM_CONTENTS 0b0000001
+#define MAC_PERM_READ 0b0000010
+#define MAC_PERM_WRITE 0b0000100
+#define MAC_PERM_EXEC 0b0001000
+#define MAC_PERM_APPEND 0b0010000
+#define MAC_PERM_FLOCK 0b0100000
+#define MAC_PERM_DEV 0b1000000
+int add_mac_permissions(const char *path, int flags);
+
+#define MAC_DENY 0b001
+#define MAC_DENY_AND_SCREAM 0b010
+#define MAC_KILL 0b100
+int set_mac_enforcement(unsigned long enforcement);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _SYS_MAC_H