https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
a

Andrey

02/24/2024, 8:26 AM
Hello everyone, tell me, is there a direct way to get a pointer to a function, for example from libc.so? I'm trying to get the logic of this code.
Copy code
void* getprt(){
    return (void *)(&open);
}
I can implement this via a.h and a.def , but would like to get rid of this
Copy code
staticCFunction(::open)
Because I'll get a link to myself.Any ideas , thanks.
c

Chanjung Kim

02/26/2024, 12:09 AM
staticCFunction(::open).rawValue
is what you want
❤️ 1
2 Views