]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/glibc/glibc-rh843673.patch
Merge branch 'next' into fifteen
[people/teissler/ipfire-2.x.git] / src / patches / glibc / glibc-rh843673.patch
CommitLineData
30a4e827
MT
1diff -Brup a/stdlib/msort.c b/stdlib/msort.c
2--- a/stdlib/msort.c 2010-05-04 07:27:23.000000000 -0400
3+++ b/stdlib/msort.c 2012-08-07 13:30:14.131765346 -0400
4@@ -25,6 +25,8 @@
5 #include <unistd.h>
6 #include <memcopy.h>
7 #include <errno.h>
8+#include <atomic.h>
9+
10
11 struct msort_param
12 {
13@@ -182,7 +184,7 @@ qsort_r (void *b, size_t n, size_t s, __
14 static long int phys_pages;
15 static int pagesize;
16
17- if (phys_pages == 0)
18+ if (pagesize == 0)
19 {
20 phys_pages = __sysconf (_SC_PHYS_PAGES);
21
22@@ -197,6 +199,9 @@ qsort_r (void *b, size_t n, size_t s, __
23 a quarter of the physical memory. */
24 phys_pages /= 4;
25
26+ /* Make sure phys_pages is written to memory. */
27+ atomic_write_barrier ();
28+
29 pagesize = __sysconf (_SC_PAGESIZE);
30 }
31