aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Andrade <andradei@proton.me>2024-08-28 22:15:11 -0600
committerIsaac Andrade <andradei@proton.me>2024-08-28 22:15:11 -0600
commit4577d541ec2b807df02c40f187a4c44dc7aa2e0f (patch)
treef92105c3e2db97ed18fadb8a089bce128edd8cbd
parentf0e631cfa348790294355d3cbc481f5984077254 (diff)
Add contants RTLD contants on os_linux and posix (dlfcn).
-rw-r--r--core/os/os_linux.odin11
-rw-r--r--core/sys/posix/dlfcn.odin9
2 files changed, 16 insertions, 4 deletions
diff --git a/core/os/os_linux.odin b/core/os/os_linux.odin
index 81ff5077a..654748305 100644
--- a/core/os/os_linux.odin
+++ b/core/os/os_linux.odin
@@ -242,10 +242,13 @@ F_SETFL: int : 4 /* Set file flags */
// NOTE(zangent): These are OS specific!
// Do not mix these up!
-RTLD_LAZY :: 0x001
-RTLD_NOW :: 0x002
-RTLD_BINDING_MASK :: 0x3
-RTLD_GLOBAL :: 0x100
+RTLD_LAZY :: 0x0001
+RTLD_NOW :: 0x0002
+RTLD_BINDING_MASK :: 0x0003
+RTLD_GLOBAL :: 0x0100
+RTLD_NOLOAD :: 0x0004
+RTLD_DEEPBIND :: 0x0008
+RTLD_NODELETE :: 0x1000
socklen_t :: c.int
diff --git a/core/sys/posix/dlfcn.odin b/core/sys/posix/dlfcn.odin
index 0ddc41337..6a467a2bd 100644
--- a/core/sys/posix/dlfcn.odin
+++ b/core/sys/posix/dlfcn.odin
@@ -111,6 +111,15 @@ when ODIN_OS == .Darwin {
RTLD_LOCAL :: RTLD_Flags{RTLD_Flag_Bits(log2(_RTLD_LOCAL))}
+} else when ODIN_OS == .Linux {
+
+ RTLD_LAZY :: 0x001
+ RTLD_NOW :: 0x002
+ RTLD_GLOBAL :: 0x100
+
+ _RTLD_LOCAL :: 0
+ RTLD_LOCAL :: RTLD_Flags{}
+
} else {
#panic("posix is unimplemented for the current target")
}