summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--src/pulsecore/memblock.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index b6b5f495..4aba536d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,7 +221,8 @@ AC_FUNC_FORK
AC_FUNC_GETGROUPS
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([chmod chown getaddrinfo getgrgid_r getpwuid_r gettimeofday \
- getuid inet_ntop inet_pton nanosleep pipe setpgid setsid sigaction sleep])
+ getuid inet_ntop inet_pton nanosleep pipe setpgid setsid sigaction sleep \
+ sysconf])
AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index c34ddee5..9e5c5b81 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -443,8 +443,14 @@ pa_mempool* pa_mempool_new(int shared) {
p = pa_xnew(pa_mempool, 1);
+#ifdef HAVE_SYSCONF
ps = (size_t) sysconf(_SC_PAGESIZE);
-
+#elif defined(PAGE_SIZE)
+ ps = (size_t) PAGE_SIZE;
+#else
+ ps = 4096; /* Let's hope it's like x86. */
+#endif
+
p->block_size = (PA_MEMPOOL_SLOT_SIZE/ps)*ps;
if (p->block_size < ps)