Edit

Share via


Dlfcn.dlsym Method

Definition

Overloads

dlsym(Dlfcn+RTLD, String)

Returns the address of the specified symbol in the current process.

dlsym(IntPtr, String)

Returns the address of the specified symbol in the dynamic library.

dlsym(Dlfcn+RTLD, String)

Returns the address of the specified symbol in the current process.

public static IntPtr dlsym (ObjCRuntime.Dlfcn.RTLD lookupType, string symbol);
static member dlsym : ObjCRuntime.Dlfcn.RTLD * string -> nativeint

Parameters

lookupType
Dlfcn.RTLD

Determines how the symbol is looked up

symbol
String

Name of the public symbol in the dynamic library to look up.

Returns

IntPtr

nativeint

Returns null if the symbol was not found. The error condition can be probed using the dlerror().

Remarks

Returns the address of the specified symbol in the dynamic library.

The lookupType controls which libraries the dynamic linker will search.

Applies to

dlsym(IntPtr, String)

Returns the address of the specified symbol in the dynamic library.

public static IntPtr dlsym (IntPtr handle, string symbol);
static member dlsym : nativeint * string -> nativeint

Parameters

handle
IntPtr

nativeint

Handle to the dynamic library previously opened with dlopen(String, Int32).

symbol
String

Name of the public symbol in the dynamic library to look up.

Returns

IntPtr

nativeint

Returns null if the symbol was not found. The error condition can be probed using the dlerror().

Remarks

Returns the address of the specified symbol in the dynamic library.

Which libraries and bundles are searched depends on the handle parameter.

The symbol name passed to dlsym() is the name used in C source code. For example to find the address of function foo(), you would pass "foo" as the symbol name. This is unlike the older dyld APIs which required a leading underscore. If you looking up a C++ symbol, you need to use the mangled C++ symbol name.

Applies to