boostorg / dll

Library for comfortable work with DLL and DSO
https://boost.org/libs/dll
52 stars 43 forks source link

Add constructor taking native_handle_t #69

Open manipuladordedados opened 8 months ago

manipuladordedados commented 8 months ago

FreeBSD exposes fdlopen() which allows one to dlopen() from a file descriptor. That's the only way to load plugins in capsicum mode. dlopen() and all functions that try to access the filesystem through pathnames fail under capsicum mode (ENOTCAPABLE).

Boost.Dll doesn't need to add functionality that can only be supported under FreeBSD (fdlopen()), but it should be very useful if the ifdef portability blocks only exist to initialize boost::dll::shared_library and nothing else (a small fdlopen() in my source at the beginning and then the rest of the code is the same for all platforms).

manipuladordedados commented 6 months ago

any news?

manipuladordedados commented 4 months ago

fdlopen() is not just a FreeBSD feature; it also exists in Android's libc (Linux). ANDROID_DLEXT_USE_LIBRARY_FD and library_fd in android_dlopen_ext(): https://developer.android.com/ndk/reference/structandroid/dlextinfo

manipuladordedados commented 4 months ago

It seems that the musl maintainers are also aware of this need, which might add weight to the importance and potential adoption of this interface across different platforms and libraries.

@apolukhin