* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
/* wincap.h: Header for OS capability class.
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef _WINCAP_H
|
|
|
|
#define _WINCAP_H
|
|
|
|
|
|
|
|
struct wincaps
|
2001-11-05 14:09:15 +08:00
|
|
|
{
|
2015-12-15 23:34:40 +08:00
|
|
|
DWORD def_guard_pages;
|
|
|
|
/* The bitfields must be 8 byte aligned on x86_64, otherwise the bitfield
|
|
|
|
ops generated by gcc are off by 4 bytes. */
|
|
|
|
struct __attribute__ ((aligned (8))) {
|
|
|
|
unsigned is_server : 1;
|
|
|
|
unsigned needs_count_in_si_lpres2 : 1;
|
|
|
|
unsigned has_gaa_largeaddress_bug : 1;
|
|
|
|
unsigned has_broken_alloc_console : 1;
|
|
|
|
unsigned has_console_logon_sid : 1;
|
|
|
|
unsigned has_precise_system_time : 1;
|
|
|
|
unsigned has_microsoft_accounts : 1;
|
|
|
|
unsigned has_processor_groups : 1;
|
|
|
|
unsigned has_broken_prefetchvm : 1;
|
|
|
|
unsigned has_new_pebteb_region : 1;
|
|
|
|
unsigned has_broken_whoami : 1;
|
2017-04-24 23:14:03 +08:00
|
|
|
unsigned has_unprivileged_createsymlink : 1;
|
2018-11-27 20:47:02 +08:00
|
|
|
unsigned has_unbiased_interrupt_time : 1;
|
|
|
|
unsigned has_precise_interrupt_time : 1;
|
2019-01-15 03:38:24 +08:00
|
|
|
unsigned has_posix_unlink_semantics : 1;
|
2018-12-25 08:07:39 +08:00
|
|
|
unsigned has_case_sensitive_dirs : 1;
|
2019-01-15 03:38:24 +08:00
|
|
|
unsigned has_posix_rename_semantics : 1;
|
2015-12-15 23:34:40 +08:00
|
|
|
};
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class wincapc
|
|
|
|
{
|
2013-11-20 06:21:11 +08:00
|
|
|
SYSTEM_INFO system_info;
|
|
|
|
RTL_OSVERSIONINFOEXW version;
|
|
|
|
char osnam[40];
|
|
|
|
ULONG_PTR wow64;
|
|
|
|
void *caps;
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
void init ();
|
|
|
|
|
2011-05-10 23:39:02 +08:00
|
|
|
const DWORD cpu_count () const { return system_info.dwNumberOfProcessors; }
|
2018-04-11 17:59:35 +08:00
|
|
|
const DWORD_PTR cpu_mask () const { return system_info.dwActiveProcessorMask;}
|
|
|
|
|
|
|
|
const WORD cpu_arch () const { return system_info.wProcessorArchitecture; }
|
|
|
|
const WORD cpu_level () const { return system_info.wProcessorLevel; }
|
|
|
|
|
2013-04-23 17:44:36 +08:00
|
|
|
/* The casts to size_t make sure that the returned value has the size of
|
|
|
|
a pointer on any system. This is important when using them for bit
|
|
|
|
mask operations, like in roundup2. */
|
|
|
|
const size_t page_size () const { return (size_t) system_info.dwPageSize; }
|
|
|
|
const size_t allocation_granularity () const
|
|
|
|
{ return (size_t) system_info.dwAllocationGranularity; }
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
const char *osname () const { return osnam; }
|
2013-04-23 17:44:36 +08:00
|
|
|
const bool is_wow64 () const { return !!wow64; }
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
2003-09-27 11:44:31 +08:00
|
|
|
#define IMPLEMENT(cap) cap() const { return ((wincaps *) this->caps)->cap; }
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
2015-07-05 04:49:30 +08:00
|
|
|
DWORD def_guard_page_size () const
|
|
|
|
{
|
|
|
|
return ((wincaps *) this->caps)->def_guard_pages * page_size ();
|
|
|
|
}
|
2003-09-27 11:44:31 +08:00
|
|
|
bool IMPLEMENT (is_server)
|
2006-12-05 18:59:21 +08:00
|
|
|
bool IMPLEMENT (needs_count_in_si_lpres2)
|
2012-05-03 16:34:44 +08:00
|
|
|
bool IMPLEMENT (has_gaa_largeaddress_bug)
|
2009-06-26 23:12:06 +08:00
|
|
|
bool IMPLEMENT (has_broken_alloc_console)
|
2011-10-16 00:31:57 +08:00
|
|
|
bool IMPLEMENT (has_console_logon_sid)
|
2013-06-14 23:41:17 +08:00
|
|
|
bool IMPLEMENT (has_precise_system_time)
|
2014-05-09 03:33:07 +08:00
|
|
|
bool IMPLEMENT (has_microsoft_accounts)
|
2015-08-13 23:59:47 +08:00
|
|
|
bool IMPLEMENT (has_processor_groups)
|
2015-08-27 19:34:10 +08:00
|
|
|
bool IMPLEMENT (has_broken_prefetchvm)
|
2015-12-03 20:33:43 +08:00
|
|
|
bool IMPLEMENT (has_new_pebteb_region)
|
2016-02-17 23:40:27 +08:00
|
|
|
bool IMPLEMENT (has_broken_whoami)
|
2017-04-24 23:14:03 +08:00
|
|
|
bool IMPLEMENT (has_unprivileged_createsymlink)
|
2018-11-27 20:47:02 +08:00
|
|
|
bool IMPLEMENT (has_unbiased_interrupt_time)
|
|
|
|
bool IMPLEMENT (has_precise_interrupt_time)
|
2019-01-15 03:38:24 +08:00
|
|
|
bool IMPLEMENT (has_posix_unlink_semantics)
|
2018-12-25 08:07:39 +08:00
|
|
|
bool IMPLEMENT (has_case_sensitive_dirs)
|
2019-01-15 03:38:24 +08:00
|
|
|
bool IMPLEMENT (has_posix_rename_semantics)
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
|
2018-12-25 08:07:39 +08:00
|
|
|
void disable_case_sensitive_dirs ()
|
|
|
|
{
|
|
|
|
((wincaps *)caps)->has_case_sensitive_dirs = false;
|
|
|
|
}
|
* Makefile.in: Build wincap.o.
* wincap.cc: New file.
* wincap.h: Ditto.
* autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
* dcrt0.cc (os_being_run): Eliminated.
(osname): Ditto.
(iswinnt): Ditto.
(set_os_type): Ditto.
(dll_crt0_1): Call wincap.init() instead of set_os_type().
(_dll_crt0): Ditto.
* environ.cc (set_chunksize): New function.
(parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
* fork.cc (chunksize): Eliminated. Moved to be member of wincap.
* host_dependent.h: Removed.
* syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
* cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
capability check throughout.
* winsup.h: Include wincap.h. Eliminate extern declarations of
`os_being_run' and `iswinnt'. Eliminate `os_type" definition.
* include/cygwin/version.h: Bump version to 1.3.4.
2001-09-13 01:46:37 +08:00
|
|
|
#undef IMPLEMENT
|
|
|
|
};
|
|
|
|
|
|
|
|
extern wincapc wincap;
|
|
|
|
|
|
|
|
#endif /* _WINCAP_H */
|