Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Lorensson <lateralusx.github@gmail.com>2019-09-12 22:31:59 +0300
committerSteve Pfister <steveisok@users.noreply.github.com>2019-09-12 22:31:59 +0300
commitdbbf43eee0c48ac053a65303d937ec47cb6b5302 (patch)
treee138c0ef0281ad2c597c5a7336fa8935c2c3ceea
parent10a9400eb51b26d85ddb62e1d369831d625a098a (diff)
Add additional checks to support more platforms. (#344)
-rw-r--r--src/Native/Unix/Common/pal_safecrt.h2
-rw-r--r--src/Native/Unix/System.Native/pal_networking.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Native/Unix/Common/pal_safecrt.h b/src/Native/Unix/Common/pal_safecrt.h
index 6682534765..1bbb51dd57 100644
--- a/src/Native/Unix/Common/pal_safecrt.h
+++ b/src/Native/Unix/Common/pal_safecrt.h
@@ -97,6 +97,7 @@ BEGIN_EXTERN_C
typedef int errno_t;
+#ifndef HAVE_MEMCPY_S
inline static errno_t memcpy_s(void* dst, size_t sizeInBytes, const void* src, size_t count)
{
if (count > 0)
@@ -124,5 +125,6 @@ inline static errno_t memcpy_s(void* dst, size_t sizeInBytes, const void* src, s
return 0;
}
+#endif
END_EXTERN_C
diff --git a/src/Native/Unix/System.Native/pal_networking.c b/src/Native/Unix/System.Native/pal_networking.c
index dc933d58bb..86a95d5004 100644
--- a/src/Native/Unix/System.Native/pal_networking.c
+++ b/src/Native/Unix/System.Native/pal_networking.c
@@ -816,6 +816,7 @@ static int32_t GetIPv4PacketInformation(struct cmsghdr* controlMessage, struct I
return 1;
}
+#ifdef IPV6_PKTINFO
static int32_t GetIPv6PacketInformation(struct cmsghdr* controlMessage, struct IPPacketInformation* packetInfo)
{
assert(controlMessage != NULL);
@@ -834,6 +835,7 @@ static int32_t GetIPv6PacketInformation(struct cmsghdr* controlMessage, struct I
return 1;
}
+#endif
static struct cmsghdr* GET_CMSG_NXTHDR(struct msghdr* mhdr, struct cmsghdr* cmsg)
{
@@ -1474,9 +1476,11 @@ static bool TryGetPlatformSocketOption(int32_t socketOptionName, int32_t socketO
*optName = SO_DEBUG;
return true;
+#ifdef SO_ACCEPTCONN
case SocketOptionName_SO_ACCEPTCONN:
*optName = SO_ACCEPTCONN;
return true;
+#endif
case SocketOptionName_SO_REUSEADDR:
*optName = SO_REUSEADDR;
@@ -1638,9 +1642,11 @@ static bool TryGetPlatformSocketOption(int32_t socketOptionName, int32_t socketO
// case SocketOptionName_SO_IPV6_PROTECTION_LEVEL:
+#ifdef IPV6_V6ONLY
case SocketOptionName_SO_IPV6_V6ONLY:
*optName = IPV6_V6ONLY;
return true;
+#endif
#ifdef IPV6_RECVPKTINFO
case SocketOptionName_SO_IP_PKTINFO:
@@ -1901,9 +1907,11 @@ static bool TryConvertProtocolTypePalToPlatform(int32_t palProtocolType, int* pl
*platformProtocolType = IPPROTO_UDP;
return true;
+#ifdef IPPROTO_ICMPV6
case ProtocolType_PT_ICMPV6:
*platformProtocolType = IPPROTO_ICMPV6;
return true;
+#endif
default:
*platformProtocolType = (int)palProtocolType;