diff options
author | Christopher Faylor <me@cgf.cx> | 2003-07-06 20:08:42 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-07-06 20:08:42 +0000 |
commit | b67171535879acf1ee66751d7ada33a99b27419e (patch) | |
tree | 12c125f2f62152b33e77f4b1d48247217e48dd9e /winsup/cygwin | |
parent | e2723b750a1106ea8b122f02b1a6364c92bc09b0 (diff) | |
download | cygnal-b67171535879acf1ee66751d7ada33a99b27419e.tar.gz cygnal-b67171535879acf1ee66751d7ada33a99b27419e.tar.bz2 cygnal-b67171535879acf1ee66751d7ada33a99b27419e.zip |
* syscalls.cc (gethostid): Set thread affinity so that results are predictable.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 17 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 8 |
2 files changed, 19 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0bc113e5d..13749d0f4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-07-06 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (gethostid): Set thread affinity so that results are + predictable. + 2003-07-05 Corinna Vinschen <corinna@vinschen.de> * mmap.cc (list::match): Add parameters to return valid address and @@ -138,7 +143,7 @@ (cygheap_user::internal_token): New member. (cygheap_user::impersonation_state): New member. (cygheap_user::issetuid): Modify. - (cygheap_user::token): New method. + (cygheap_user::token): New method. (cygheap_user::deimpersonate): New method. (cygheap_user::reimpersonate): New method. (cygheap_user::has_impersonation_tokens): New method. @@ -190,9 +195,9 @@ 2003-06-18 Pierre Humblet <pierre.humblet@ieee.org> - * autoload.cc (GetNetworkParams): Add. - * net.cc (getdomainname): Call GetNetworkParams and read the - DhcpDomain registry value if warranted. + * autoload.cc (GetNetworkParams): Add. + * net.cc (getdomainname): Call GetNetworkParams and read the + DhcpDomain registry value if warranted. 2003-06-17 Christopher Faylor <cgf@redhat.com> @@ -451,7 +456,7 @@ (fhandler_base::lseek): Call set_did_lseek() instead of set_check_win95_lseek_bug(). (fhandler_base::fhandler_base): Initialize fs_flags to 0. - * fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files + * fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files as "sparse" unconditionally. Set fs_flags member. 2003-05-25 Pierre Humblet <pierre.humblet@ieee.org> @@ -529,7 +534,7 @@ * dcrt0.cc (dll_crt_0_1) Fix calls to MTinterface::Init and pthread::init_mainthread. Call pthread::init_mainthread only when not forked. - + 2003-05-15 Corinna Vinschen <corinna@vinschen.de> * fhandler_proc.cc (format_proc_meminfo): Make swap memory output diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index a22f4ee06..5ef18ce7e 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2787,6 +2787,11 @@ long gethostid(void) 0x00290012}; bool has_cpuid = false; + sigframe thisframe (mainthread); + + DWORD opmask = SetThreadAffinityMask (GetCurrentThread (), 1); + if (!opmask) + debug_printf ("SetThreadAffinityMask to 1 failed, %E"); if (!can_set_flag (0x00040000)) debug_printf ("386 processor - no cpuid"); @@ -2870,6 +2875,9 @@ long gethostid(void) for (int i=0;i<13;i++) hostid ^= ((data[i] << (i << 2)) | (data[i] >> (32 - (i << 2)))); + if (opmask && !SetThreadAffinityMask (GetCurrentThread (), opmask)) + debug_printf ("SetThreadAffinityMask to %p failed, %E", opmask); + debug_printf ("hostid: %08x", hostid); return hostid; |