1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fix errno

This commit is contained in:
disarray2077 2021-11-01 14:06:07 -03:00 committed by GitHub
parent 4188f607c7
commit 6a1d055325
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -176,9 +176,16 @@ namespace System.Net
[Import("wsock32.lib"), CLink, CallingConvention(.Stdcall)]
static extern int32 WSAGetLastError();
#elif BF_PLATFORM_LINUX
[LinkName("__errno_location")]
static extern int32* _errno();
#elif BF_PLATFORM_MACOS
[LinkName("__error")]
static extern int32* _errno();
#else
[CLink]
static int32 errno;
static int32* _errno() => &errno;
#endif
[CLink, CallingConvention(.Stdcall)]
@ -258,7 +265,7 @@ namespace System.Net
#if BF_PLATFORM_WINDOWS
return WSAGetLastError();
#else
return errno;
return *_errno();
#endif
}