Class DynamicLinkLoader

java.lang.Object
org.lwjgl.system.linux.DynamicLinkLoader

public class DynamicLinkLoader extends Object
Native bindings to <dlfcn.h>.
  • Field Details

  • Method Details

    • ndlopen

      public static long ndlopen(long filename, int mode)
    • dlopen

      public static long dlopen(@Nullable ByteBuffer filename, int mode)
      Loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library. If filename is NULL, then the returned handle is for the main program.
      Parameters:
      filename - the name of the dynamic library to open, or NULL
      mode - a bitfield. One or more of:
      RTLD_LAZYRTLD_NOWRTLD_BINDING_MASKRTLD_NOLOADRTLD_DEEPBINDRTLD_GLOBAL
      RTLD_LOCALRTLD_NODELETE
    • dlopen

      public static long dlopen(@Nullable CharSequence filename, int mode)
      Loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library. If filename is NULL, then the returned handle is for the main program.
      Parameters:
      filename - the name of the dynamic library to open, or NULL
      mode - a bitfield. One or more of:
      RTLD_LAZYRTLD_NOWRTLD_BINDING_MASKRTLD_NOLOADRTLD_DEEPBINDRTLD_GLOBAL
      RTLD_LOCALRTLD_NODELETE
    • ndlerror

      public static long ndlerror()
      Unsafe version of: dlerror()
    • dlerror

      @Nullable public static String dlerror()
      Returns a human readable string describing the most recent error that occurred from dlopen(java.nio.ByteBuffer, int), dlsym(long, java.nio.ByteBuffer) or dlclose(long) since the last call to dlerror(). It returns NULL if no errors have occurred since initialization or since it was last called.
    • ndlsym

      public static long ndlsym(long handle, long name)
    • dlsym

      public static long dlsym(long handle, ByteBuffer name)
      Takes a "handle" of a dynamic library returned by dlopen(java.nio.ByteBuffer, int) and the null-terminated symbol name, returning the address where that symbol is loaded into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded by dlopen(java.nio.ByteBuffer, int) when that library was loaded, dlsym() returns NULL.
      Parameters:
      handle - the dynamic library handle
      name - the symbol name
    • dlsym

      public static long dlsym(long handle, CharSequence name)
      Takes a "handle" of a dynamic library returned by dlopen(java.nio.ByteBuffer, int) and the null-terminated symbol name, returning the address where that symbol is loaded into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded by dlopen(java.nio.ByteBuffer, int) when that library was loaded, dlsym() returns NULL.
      Parameters:
      handle - the dynamic library handle
      name - the symbol name
    • ndlclose

      public static int ndlclose(long handle)
      Unsafe version of: dlclose(long)
    • dlclose

      public static int dlclose(long handle)
      Decrements the reference count on the dynamic library handle handle. If the reference count drops to zero and no other loaded libraries use symbols in it, then the dynamic library is unloaded.
      Parameters:
      handle - the dynamic library to close