]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: Fix default guard size
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 9 Feb 2020 17:27:38 +0000 (17:27 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 9 Feb 2020 17:28:33 +0000 (17:28 +0000)
When it is not hardcoded by the architecture with PAGESIZE, we need to
use the dynamic values from __vm_page_size.

htl/pt-internal.h
sysdeps/htl/pt-attr.c
sysdeps/mach/hurd/htl/pt-sysdep.c

index 9147b87740020d3567bc13f5657cd0f69c8ce6cb..064e79515731aba0f6b1106ceb232f0a609139ef 100644 (file)
@@ -304,7 +304,7 @@ extern error_t __pthread_sigstate (struct __pthread *__restrict thread, int how,
 \f
 
 /* Default thread attributes.  */
-extern const struct __pthread_attr __pthread_default_attr;
+extern struct __pthread_attr __pthread_default_attr;
 
 /* Default barrier attributes.  */
 extern const struct __pthread_barrierattr __pthread_default_barrierattr;
index 1426fac67e0cba152abba24ddf69d98d4d15bc38..fb41e4859fdb18b506636f8c2909c9d214a06b72 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <pt-internal.h>
 
-const struct __pthread_attr __pthread_default_attr = {
+struct __pthread_attr __pthread_default_attr = {
   __schedparam: { sched_priority: 0 },
   __stacksize: 0,
   __stackaddr: NULL,
index 32a290c4ee6f54fc204c9692cdf7514b717e7062..84d191475ddb0293b18fa8697d44becd3e136dca 100644 (file)
@@ -78,6 +78,10 @@ _init_routine (void *stack)
      valid if the main thread terminates.  */
   thread->stack = 0;
 
+#ifndef PAGESIZE
+  __pthread_default_attr.__guardsize = __vm_page_size;
+#endif
+
   ___pthread_self = thread;
 
   /* Decrease the number of threads, to take into account that the