pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

corefx-git: Add networking features detections



Module Name:	pkgsrc-wip
Committed By:	jasonwilliams200ok <necmon%yahoo.com@localhost>
Pushed By:	danglingpointer
Date:		Tue Feb 9 00:56:35 2016 +0000
Changeset:	45147e51119c1650916e1ceef871ccb398f63731

Modified Files:
	corefx-git/distinfo
	corefx-git/patches/patch-src_Native_Common_pal__config.h.in
	corefx-git/patches/patch-src_Native_System.Native_pal__errno.cpp
	corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
	corefx-git/patches/patch-src_Native_configure.cmake

Log Message:
corefx-git: Add networking features detections

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=45147e51119c1650916e1ceef871ccb398f63731

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 corefx-git/distinfo                                |   8 +-
 .../patch-src_Native_Common_pal__config.h.in       |  14 ++-
 .../patch-src_Native_System.Native_pal__errno.cpp  |  32 +------
 ...ch-src_Native_System.Native_pal__networking.cpp | 101 ++++++++++++++++++++-
 .../patches/patch-src_Native_configure.cmake       |  41 ++++++++-
 5 files changed, 159 insertions(+), 37 deletions(-)

diffs:
diff --git a/corefx-git/distinfo b/corefx-git/distinfo
index 2a5979d..f4ad725 100644
--- a/corefx-git/distinfo
+++ b/corefx-git/distinfo
@@ -1,9 +1,9 @@
 $NetBSD$
 SHA1 (patch-src_Native_CMakeLists.txt) = 07568f980cad506f0c3e3c40448f164dcdd4fcb4
-SHA1 (patch-src_Native_Common_pal__config.h.in) = b42af66a61b43cd682d2f54f775299990170a702
-SHA1 (patch-src_Native_System.Native_pal__errno.cpp) = 35ceb59ed13e0a3ba4007bf5e4aae375bbaed5c0
+SHA1 (patch-src_Native_Common_pal__config.h.in) = 37fa257faf95a5da68f9dfa2e609afdaddd1ed9a
+SHA1 (patch-src_Native_System.Native_pal__errno.cpp) = 75f34599240aa87699320c6b2fee6c2a8bac2a16
 SHA1 (patch-src_Native_System.Native_pal__interfaceaddresses.cpp) = 4f82e6f028fe2b9826ba6afb62869e42a0b6ee3d
 SHA1 (patch-src_Native_System.Native_pal__mount.cpp) = 7858f5ff60fcb0d60452648aef1b1034698e2c85
-SHA1 (patch-src_Native_System.Native_pal__networking.cpp) = 0ece22414c357580a0ea3f6f13b2325a37e4afb1
-SHA1 (patch-src_Native_configure.cmake) = c17b54e1302f17404806da0618bc7ee174f82535
+SHA1 (patch-src_Native_System.Native_pal__networking.cpp) = 71183f8f7c68697401468c49216fb249fe0df099
+SHA1 (patch-src_Native_configure.cmake) = c4d12c3a55c97804fd053c6923df08fe72c4d91d
 SHA1 (patch-src_Native_gen-buildsys-clang.sh) = efc34b0da3d11b1c66625336bb4d3c7ac5273b60
diff --git a/corefx-git/patches/patch-src_Native_Common_pal__config.h.in b/corefx-git/patches/patch-src_Native_Common_pal__config.h.in
index dded842..1124596 100644
--- a/corefx-git/patches/patch-src_Native_Common_pal__config.h.in
+++ b/corefx-git/patches/patch-src_Native_Common_pal__config.h.in
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- src/Native/Common/pal_config.h.in.orig	2016-02-08 16:12:54.000000000 +0000
 +++ src/Native/Common/pal_config.h.in
-@@ -7,6 +7,7 @@
+@@ -7,21 +7,27 @@
  #cmakedefine01 HAVE_DIRENT_NAME_LEN
  #cmakedefine01 HAVE_MNTINFO
  #cmakedefine01 HAVE_STATFS_FSTYPENAME
@@ -10,7 +10,15 @@ $NetBSD$
  #cmakedefine01 HAVE_STRCPY_S
  #cmakedefine01 HAVE_STRLCPY
  #cmakedefine01 HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP
-@@ -20,8 +21,11 @@
+ #cmakedefine01 HAVE_POSIX_ADVISE
+ #cmakedefine01 PRIORITY_REQUIRES_INT_WHO
++#cmakedefine01 KEVENT_REQUIRES_SIZE_T_NUMERICS
+ #cmakedefine01 HAVE_IN6_U
+ #cmakedefine01 HAVE_IOCTL
+ #cmakedefine01 HAVE_TIOCGWINSZ
+ #cmakedefine01 HAVE_SCHED_GETAFFINITY
+ #cmakedefine01 HAVE_SCHED_SETAFFINITY
++#cmakedefine01 KEVENT_HAS_NUMERIC_DATA
  #cmakedefine01 HAVE_FDS_BITS
  #cmakedefine01 HAVE_PRIVATE_FDS_BITS
  #cmakedefine01 HAVE_ALLOCA_H
@@ -22,7 +30,7 @@ $NetBSD$
  #cmakedefine01 HAVE_GETHOSTBYNAME_R
  #cmakedefine01 HAVE_GETHOSTBYADDR_R
  #cmakedefine01 HAVE_SUPPORT_FOR_DUAL_MODE_IPV4_PACKET_INFO
-@@ -32,6 +36,8 @@
+@@ -32,6 +38,8 @@
  #cmakedefine01 HAVE_ICANON
  #cmakedefine01 HAVE_TCSANOW
  #cmakedefine01 HAVE_IN_PKTINFO
diff --git a/corefx-git/patches/patch-src_Native_System.Native_pal__errno.cpp b/corefx-git/patches/patch-src_Native_System.Native_pal__errno.cpp
index 756867f..196f04a 100644
--- a/corefx-git/patches/patch-src_Native_System.Native_pal__errno.cpp
+++ b/corefx-git/patches/patch-src_Native_System.Native_pal__errno.cpp
@@ -46,36 +46,14 @@ $NetBSD$
          case PAL_EPERM:
              return EPERM;
          case PAL_EPIPE:
-@@ -339,20 +347,19 @@ extern "C" int32_t SystemNative_ConvertE
+@@ -339,9 +347,9 @@ extern "C" int32_t SystemNative_ConvertE
          case PAL_EXDEV:
              return EXDEV;
          case PAL_ENONSTANDARD:
--            break; // fall through to assert
 +        default:
-+            // We should not use this function to round-trip platform -> pal
-+            // -> platform. It's here only to synthesize a platform number
-+            // from the fixed set above. Note that the assert is outside the
-+            // switch rather than in a default case block because not
-+            // having a default will trigger a warning (as error) if there's
-+            // an enum value we haven't handled. Should that trigger, make
-+            // note that there is probably a corresponding missing case in the
-+            // other direction above, but the compiler can't warn in that case
-+            // because the platform values are not part of an enum.
-+            assert(false && "Unknown error code");
-+            return -1;
+             break; // fall through to assert
      }
 -
--    // We should not use this function to round-trip platform -> pal
--    // -> platform. It's here only to synthesize a platform number
--    // from the fixed set above. Note that the assert is outside the
--    // switch rather than in a default case block because not
--    // having a default will trigger a warning (as error) if there's
--    // an enum value we haven't handled. Should that trigger, make
--    // note that there is probably a corresponding missing case in the
--    // other direction above, but the compiler can't warn in that case
--    // because the platform values are not part of an enum.
--    assert(false && "Unknown error code");
--    return -1;
- }
- 
- extern "C" const char* SystemNative_StrErrorR(int32_t platformErrno, char* buffer, int32_t bufferSize)
+     // We should not use this function to round-trip platform -> pal
+     // -> platform. It's here only to synthesize a platform number
+     // from the fixed set above. Note that the assert is outside the
diff --git a/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp b/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
index 422d957..8cc2301 100644
--- a/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
+++ b/corefx-git/patches/patch-src_Native_System.Native_pal__networking.cpp
@@ -106,8 +106,8 @@ $NetBSD$
 +#endif /* defined(HAVE_GETNAMEINFO) */
 +
 +#if defined(HAVE_GETADDRINFO)
-+static int gethostbyaddr_r(const uint8_t* addr, const socklen_t len, int type, struct hostent* result, 
-+                                       char* buffer, size_t buflen, hostent** entry, int* error)
++static int gethostbyaddr_r(const uint8_t* addr, const socklen_t len, int type, struct hostent* result,
++                           char* buffer, size_t buflen, hostent** entry, int* error)
 +{
 +#ifdef HAVE_PTHREAD_H
 +    if (fr_hostbyaddr == 0)
@@ -218,3 +218,100 @@ $NetBSD$
      int err = setsockopt(socket, IPPROTO_IP, optionName, &opt, sizeof(opt));
      return err == 0 ? PAL_SUCCESS : SystemNative_ConvertErrorPlatformToPal(errno);
  }
+@@ -1729,21 +1873,29 @@ static bool TryGetPlatformSocketOption(i
+ 
+                 // case PAL_SO_IP_DONTFRAGMENT:
+ 
++#ifdef IP_ADD_SOURCE_MEMBERSHIP
+                 case PAL_SO_IP_ADD_SOURCE_MEMBERSHIP:
+                     optName = IP_ADD_SOURCE_MEMBERSHIP;
+                     return true;
++#endif
+ 
++#ifdef IP_DROP_SOURCE_MEMBERSHIP
+                 case PAL_SO_IP_DROP_SOURCE_MEMBERSHIP:
+                     optName = IP_DROP_SOURCE_MEMBERSHIP;
+                     return true;
++#endif
+ 
++#ifdef IP_BLOCK_SOURCE
+                 case PAL_SO_IP_BLOCK_SOURCE:
+                     optName = IP_BLOCK_SOURCE;
+                     return true;
++#endif
+ 
++#ifdef IP_UNBLOCK_SOURCE
+                 case PAL_SO_IP_UNBLOCK_SOURCE:
+                     optName = IP_UNBLOCK_SOURCE;
+                     return true;
++#endif
+ 
+                 case PAL_SO_IP_PKTINFO:
+                     optName = IP_PKTINFO;
+@@ -2317,8 +2469,13 @@ static Error CloseSocketEventPortInner(i
+ static Error TryChangeSocketEventRegistrationInner(
+     int32_t port, int32_t socket, SocketEvents currentEvents, SocketEvents newEvents, uintptr_t data)
+ {
++#ifdef EV_RECEIPT
+     const uint16_t AddFlags = EV_ADD | EV_CLEAR | EV_RECEIPT;
+     const uint16_t RemoveFlags = EV_DELETE | EV_RECEIPT;
++#else
++    const uint16_t AddFlags = EV_ADD | EV_CLEAR;
++    const uint16_t RemoveFlags = EV_DELETE;
++#endif
+ 
+     assert(currentEvents != newEvents);
+ 
+@@ -2337,7 +2494,11 @@ static Error TryChangeSocketEventRegistr
+                (newEvents & PAL_SA_READ) == 0 ? RemoveFlags : AddFlags,
+                0,
+                0,
++#if KEVENT_HAS_NUMERIC_DATA
++               data);
++#else
+                reinterpret_cast<void*>(data));
++#endif
+     }
+ 
+     if (writeChanged)
+@@ -2348,11 +2509,15 @@ static Error TryChangeSocketEventRegistr
+                (newEvents & PAL_SA_WRITE) == 0 ? RemoveFlags : AddFlags,
+                0,
+                0,
+-               reinterpret_cast<void*>(data));
++               data);
+     }
+ 
+     int err;
++#if KEVENT_REQUIRES_SIZE_T_NUMERICS
++    while (CheckInterrupted(err = kevent(port, events, static_cast<size_t>(i), nullptr, 0, nullptr)));
++#else
+     while (CheckInterrupted(err = kevent(port, events, i, nullptr, 0, nullptr)));
++#endif
+     return err == 0 ? PAL_SUCCESS : SystemNative_ConvertErrorPlatformToPal(errno);
+ }
+ 
+@@ -2364,7 +2529,11 @@ static Error WaitForSocketEventsInner(in
+ 
+     auto* events = reinterpret_cast<struct kevent*>(buffer);
+     int numEvents;
++#if KEVENT_REQUIRES_SIZE_T_NUMERICS
++    while (CheckInterrupted(numEvents = kevent(port, nullptr, 0, events, static_cast<size_t>(*count), nullptr)));
++#else
+     while (CheckInterrupted(numEvents = kevent(port, nullptr, 0, events, *count, nullptr)));
++#endif
+     if (numEvents == -1)
+     {
+         *count = -1;
+@@ -2382,7 +2551,11 @@ static Error WaitForSocketEventsInner(in
+     {
+         // This copy is made deliberately to avoid overwriting data.
+         struct kevent evt = events[i];
++#if KEVENT_HAS_NUMERIC_DATA
++        buffer[i] = {.Data = static_cast<unsigned long>(evt.udata), .Events = GetSocketEvents(static_cast<short>(evt.filter), static_cast<unsigned short>(evt.flags))};
++#else
+         buffer[i] = {.Data = reinterpret_cast<uintptr_t>(evt.udata), .Events = GetSocketEvents(evt.filter, evt.flags)};
++#endif
+     }
+ 
+     *count = numEvents;
diff --git a/corefx-git/patches/patch-src_Native_configure.cmake b/corefx-git/patches/patch-src_Native_configure.cmake
index 3152d1a..98f5334 100644
--- a/corefx-git/patches/patch-src_Native_configure.cmake
+++ b/corefx-git/patches/patch-src_Native_configure.cmake
@@ -58,7 +58,27 @@ $NetBSD$
      "struct in6_addr"
      __in6_u
      "netdb.h"
-@@ -157,6 +185,18 @@ check_function_exists(
+@@ -129,6 +157,19 @@ check_cxx_source_compiles(
+     "
+     HAVE_GNU_STRERROR_R)
+ 
++check_c_source_compiles(
++    "
++    #include <sys/event.h>
++    int main(void)
++    {
++        struct kevent event;
++        uintptr_t data;
++        EV_SET(&event, 0, EVFILT_READ, 0, 0, 0, data);
++        return 0;
++    }
++    "
++    KEVENT_HAS_NUMERIC_DATA)
++
+ check_struct_has_member(
+     "struct fd_set"
+     fds_bits
+@@ -157,6 +198,18 @@ check_function_exists(
      gethostbyaddr_r
      HAVE_GETHOSTBYADDR_R)
  
@@ -77,3 +97,22 @@ $NetBSD$
  set(HAVE_SUPPORT_FOR_DUAL_MODE_IPV4_PACKET_INFO 0)
  set(HAVE_THREAD_SAFE_GETHOSTBYNAME_AND_GETHOSTBYADDR 0)
  
+@@ -214,10 +267,17 @@ check_cxx_source_runs(
+ check_prototype_definition(
+     getpriority
+     "int getpriority(int which, int who)"
+-    "0"
++    0
+     "sys/resource.h"
+     PRIORITY_REQUIRES_INT_WHO)
+ 
++check_prototype_definition(
++    kevent
++    "int kevent(int kg, const struct kevent *chagelist, size_t nchanges, struct kevent *eventlist, size_t nevents, const struct timespec *timeout)"
++    0
++    "sys/event.h"
++    KEVENT_REQUIRES_SIZE_T_NUMERICS)
++
+ check_cxx_source_compiles(
+     "
+     #include <sys/types.h>


Home | Main Index | Thread Index | Old Index