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>
This commit is contained in:
		| @@ -8,6 +8,7 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for | |||||||
| details. */ | details. */ | ||||||
|  |  | ||||||
| #include "winsup.h" | #include "winsup.h" | ||||||
|  | #include "miscfuncs.h" | ||||||
| #include "security.h" | #include "security.h" | ||||||
| #include "ntdll.h" | #include "ntdll.h" | ||||||
|  |  | ||||||
| @@ -34,6 +35,7 @@ wincaps wincap_vista __attribute__((section (".cygwin_dll_common"), shared)) = { | |||||||
|     has_unprivileged_createsymlink:false, |     has_unprivileged_createsymlink:false, | ||||||
|     has_unbiased_interrupt_time:false, |     has_unbiased_interrupt_time:false, | ||||||
|     has_precise_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_unprivileged_createsymlink:false, | ||||||
|     has_unbiased_interrupt_time:true, |     has_unbiased_interrupt_time:true, | ||||||
|     has_precise_interrupt_time:false, |     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_unprivileged_createsymlink:false, | ||||||
|     has_unbiased_interrupt_time:true, |     has_unbiased_interrupt_time:true, | ||||||
|     has_precise_interrupt_time:false, |     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, |   def_guard_pages:2, | ||||||
|   { |   { | ||||||
|     is_server:false, |     is_server:false, | ||||||
| @@ -94,6 +98,7 @@ wincaps wincap_10 __attribute__((section (".cygwin_dll_common"), shared)) = { | |||||||
|     has_unprivileged_createsymlink:false, |     has_unprivileged_createsymlink:false, | ||||||
|     has_unbiased_interrupt_time:true, |     has_unbiased_interrupt_time:true, | ||||||
|     has_precise_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_unprivileged_createsymlink:false, | ||||||
|     has_unbiased_interrupt_time:true, |     has_unbiased_interrupt_time:true, | ||||||
|     has_precise_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_unprivileged_createsymlink:true, | ||||||
|     has_unbiased_interrupt_time:true, |     has_unbiased_interrupt_time:true, | ||||||
|     has_precise_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; | 	      caps = &wincap_8; | ||||||
| 	      break; | 	      break; | ||||||
| 	    default: | 	    default: | ||||||
| 	      caps = &wincap_10; | 	      caps = &wincap_10_1507; | ||||||
| 	      break; | 	      break; | ||||||
| 	  } | 	  } | ||||||
| 	break; | 	break; | ||||||
|       case 10: |       case 10: | ||||||
|       default: |       default: | ||||||
| 	if (version.dwBuildNumber < 10586) | 	if (likely (version.dwBuildNumber >= 16299)) | ||||||
| 	  caps = &wincap_10; | 	  caps = &wincap_10_1709; | ||||||
| 	else if (version.dwBuildNumber < 15063) | 	else if (version.dwBuildNumber >= 15063) | ||||||
|  | 	  caps = &wincap_10_1703; | ||||||
|  | 	else if (version.dwBuildNumber >= 10586) | ||||||
| 	  caps = &wincap_10_1511; | 	  caps = &wincap_10_1511; | ||||||
| 	else | 	else | ||||||
| 	  caps = &wincap_10_1703; | 	  caps = & wincap_10_1507; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   ((wincaps *)caps)->is_server = (version.wProductType != VER_NT_WORKSTATION); |   ((wincaps *)caps)->is_server = (version.wProductType != VER_NT_WORKSTATION); | ||||||
|   | |||||||
| @@ -29,6 +29,7 @@ struct wincaps | |||||||
|     unsigned has_unprivileged_createsymlink	: 1; |     unsigned has_unprivileged_createsymlink	: 1; | ||||||
|     unsigned has_unbiased_interrupt_time	: 1; |     unsigned has_unbiased_interrupt_time	: 1; | ||||||
|     unsigned has_precise_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_unprivileged_createsymlink) | ||||||
|   bool	IMPLEMENT (has_unbiased_interrupt_time) |   bool	IMPLEMENT (has_unbiased_interrupt_time) | ||||||
|   bool	IMPLEMENT (has_precise_interrupt_time) |   bool	IMPLEMENT (has_precise_interrupt_time) | ||||||
|  |   bool	IMPLEMENT (has_posix_file_info) | ||||||
|  |  | ||||||
| #undef IMPLEMENT | #undef IMPLEMENT | ||||||
| }; | }; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user