[newlib-cygwin] Cygwin: wincap: add wincap_10_1709, add has_posix_file_info item

Corinna Vinschen corinna@sourceware.org
Sat Dec 22 23:24:00 GMT 2018


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=092a768885fceb0962c8654b176d1046e2af081d

commit 092a768885fceb0962c8654b176d1046e2af081d
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Sun Dec 23 00:21:21 2018 +0100

    Cygwin: wincap: add wincap_10_1709, add has_posix_file_info item
    
    Various new file info class members adding important POSIX semantics
    have been added with W10 1709.  We may want to utilize them, so add
    a matching wincaps.
    
    Rearrange checking the W10 build number to prefer the latest builds
    over the older builds.  Rename wincap_10 to wincap_10_1507 for
    enhanced clarity.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/wincap.cc | 42 ++++++++++++++++++++++++++++++++++++------
 winsup/cygwin/wincap.h  |  2 ++
 2 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index d5d8ef6..4ba9aa5 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -8,6 +8,7 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
 #include "winsup.h"
+#include "miscfuncs.h"
 #include "security.h"
 #include "ntdll.h"
 
@@ -34,6 +35,7 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_unprivileged_createsymlink:false,
     has_unbiased_interrupt_time:false,
     has_precise_interrupt_time:false,
+    has_posix_file_info:false,
   },
 };
 
@@ -54,6 +56,7 @@ wincaps wincap_7 __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_unprivileged_createsymlink:false,
     has_unbiased_interrupt_time:true,
     has_precise_interrupt_time:false,
+    has_posix_file_info:false,
   },
 };
 
@@ -74,10 +77,11 @@ wincaps wincap_8 __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_unprivileged_createsymlink:false,
     has_unbiased_interrupt_time:true,
     has_precise_interrupt_time:false,
+    has_posix_file_info:false,
   },
 };
 
-wincaps wincap_10 __attribute__((section (".cygwin_dll_common"), shared)) = {
+wincaps  wincap_10_1507 __attribute__((section (".cygwin_dll_common"), shared)) = {
   def_guard_pages:2,
   {
     is_server:false,
@@ -94,6 +98,7 @@ wincaps wincap_10 __attribute__((section (".cygwin_dll_common"), shared)) = {
     has_unprivileged_createsymlink:false,
     has_unbiased_interrupt_time:true,
     has_precise_interrupt_time:true,
+    has_posix_file_info:false,
   },
 };
 
@@ -114,6 +119,7 @@ wincaps wincap_10_1511 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_unprivileged_createsymlink:false,
     has_unbiased_interrupt_time:true,
     has_precise_interrupt_time:true,
+    has_posix_file_info:false,
   },
 };
 
@@ -134,6 +140,28 @@ wincaps wincap_10_1703 __attribute__((section (".cygwin_dll_common"), shared)) =
     has_unprivileged_createsymlink:true,
     has_unbiased_interrupt_time:true,
     has_precise_interrupt_time:true,
+    has_posix_file_info:false,
+  },
+};
+
+wincaps wincap_10_1709 __attribute__((section (".cygwin_dll_common"), shared)) = {
+  def_guard_pages:2,
+  {
+    is_server:false,
+    needs_count_in_si_lpres2:false,
+    has_gaa_largeaddress_bug:false,
+    has_broken_alloc_console:true,
+    has_console_logon_sid:true,
+    has_precise_system_time:true,
+    has_microsoft_accounts:true,
+    has_processor_groups:true,
+    has_broken_prefetchvm:false,
+    has_new_pebteb_region:true,
+    has_broken_whoami:false,
+    has_unprivileged_createsymlink:true,
+    has_unbiased_interrupt_time:true,
+    has_precise_interrupt_time:true,
+    has_posix_file_info:true,
   },
 };
 
@@ -171,18 +199,20 @@ wincapc::init ()
 	      caps = &wincap_8;
 	      break;
 	    default:
-	      caps = &wincap_10;
+	      caps = &wincap_10_1507;
 	      break;
 	  }
 	break;
       case 10:
       default:
-	if (version.dwBuildNumber < 10586)
-	  caps = &wincap_10;
-	else if (version.dwBuildNumber < 15063)
+	if (likely (version.dwBuildNumber >= 16299))
+	  caps = &wincap_10_1709;
+	else if (version.dwBuildNumber >= 15063)
+	  caps = &wincap_10_1703;
+	else if (version.dwBuildNumber >= 10586)
 	  caps = &wincap_10_1511;
 	else
-	  caps = &wincap_10_1703;
+	  caps = & wincap_10_1507;
     }
 
   ((wincaps *)caps)->is_server = (version.wProductType != VER_NT_WORKSTATION);
diff --git a/winsup/cygwin/wincap.h b/winsup/cygwin/wincap.h
index cc1c6ba..6492462 100644
--- a/winsup/cygwin/wincap.h
+++ b/winsup/cygwin/wincap.h
@@ -29,6 +29,7 @@ struct wincaps
     unsigned has_unprivileged_createsymlink	: 1;
     unsigned has_unbiased_interrupt_time	: 1;
     unsigned has_precise_interrupt_time		: 1;
+    unsigned has_posix_file_info		: 1;
   };
 };
 
@@ -78,6 +79,7 @@ public:
   bool	IMPLEMENT (has_unprivileged_createsymlink)
   bool	IMPLEMENT (has_unbiased_interrupt_time)
   bool	IMPLEMENT (has_precise_interrupt_time)
+  bool	IMPLEMENT (has_posix_file_info)
 
 #undef IMPLEMENT
 };



More information about the Cygwin-cvs mailing list