linux-loader provides dynamic library loading helpers (dlopen, dlsym,
dlclose), memoized handle caching, and convenience dispatch helpers for
arbitrary Linux shared libraries.
loader := import('linux-loader')
Module-level cache map of library -> handle values.
Creates a stable cache key for either:
- a single library name/path string, or
- a candidate list (uses the first element or
[]for empty lists)
Normalizes sys.call style results into {type: :ok|:error, ...} objects.
Thin wrappers over libdl entry points.
Attempts dlopen for each candidate path/name in order.
Loads a shared library and caches the handle.
librarycan be a string or a candidate list.- success shape:
{type: :ok, handle: <int>, library: <string>}
Ensures library is loaded, then resolves symbol with dlsym.
Resolve + call helper.
- first tries cached loaded-handle dispatch
- if that fails, falls back to
resolveIn/_resolveFirst
Convenience wrapper for dispatching through LibX11 candidates.
loader := import('linux-loader')
res := loader.callIn(['libc.so.6', 'libc.so'], 'getpid')
println(string(res.r1))