Use NativeLibrary.TryLoad and prefer RTLD_LAZY over RTLD_NOW (dotnet/corefx#35548)
authorAdeel Mujahid <adeelbm@outlook.com>
Tue, 26 Feb 2019 02:44:03 +0000 (04:44 +0200)
committerStephen Toub <stoub@microsoft.com>
Tue, 26 Feb 2019 02:44:03 +0000 (21:44 -0500)
commit3fda13adcef2a78834b142649bb59cd5baa0f179
tree84bd262b346fb704f37a093b2da6105fed300bda
parent51ac046f6afbb2ae73a41306184fbaabbead5edc
Use NativeLibrary.TryLoad and prefer RTLD_LAZY over RTLD_NOW (dotnet/corefx#35548)

* Use NativeLibrary.TryLoad in ODBC test

* Use RTLD_LAZY instead of RTLD_NOW

* Add missing using statement

* More RTLD_NOW -> RTLD_LAZY

* Remove unused RTLD_NOW constant

* Use NativeLibrary.TryLoad instead of P/Invoke dlopen

* Inline method body in property

* Add fallback for netcoreapp2x and below

* Reduce visibility of const

Commit migrated from https://github.com/dotnet/corefx/commit/863b9bff2d77669b426b52dcb1bf7ba9246729e0
src/libraries/Common/src/Interop/Unix/libdl/Interop.dlopen.cs
src/libraries/CoreFx.Private.TestUtilities/src/System/PlatformDetection.Unix.cs
src/libraries/System.Data.Odbc/tests/Helpers.cs
src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs