+2010-12-09 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #11655]
+ * stdlib/msort.c (qsort_r): Make sure both phys_pages and pagesize
+ are initialized.
+
2010-12-09 Jakub Jelinek <jakub@redhat.com>
* string/bits/string3.h (memmove, bcopy): Remove __restrict.
#include <unistd.h>
#include <memcopy.h>
#include <errno.h>
+#include <atomic.h>
struct msort_param
{
static long int phys_pages;
static int pagesize;
- if (phys_pages == 0)
+ if (pagesize == 0)
{
phys_pages = __sysconf (_SC_PHYS_PAGES);
a quarter of the physical memory. */
phys_pages /= 4;
+ /* Make sure phys_pages is written to memory. */
+ atomic_write_barrier ();
+
pagesize = __sysconf (_SC_PAGESIZE);
}