summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-08-22 11:41:14 +0000
committerPierre Ossman <ossman@cendio.se>2006-08-22 11:41:14 +0000
commit10bbc4b7c9e6aed6e0b281eaf23b8192e53233d7 (patch)
treeb19bf6b3b1b887a6d6ea05c9955badb019c83f29 /src
parent568c8ea7158d3f94793f27768afbd639558a932f (diff)
Fix detection of shared memory support and proper fallback.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1316 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
-rw-r--r--src/modules/module-oss-mmap.c3
-rw-r--r--src/pulsecore/shm.c25
2 files changed, 27 insertions, 1 deletions
diff --git a/src/modules/module-oss-mmap.c b/src/modules/module-oss-mmap.c
index 0be6bbe2..5ab08287 100644
--- a/src/modules/module-oss-mmap.c
+++ b/src/modules/module-oss-mmap.c
@@ -34,7 +34,10 @@
#include <fcntl.h>
#include <unistd.h>
#include <limits.h>
+
+#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
+#endif
#include <pulse/xmalloc.h>
#include <pulse/util.h>
diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c
index 02528126..7c10bd0a 100644
--- a/src/pulsecore/shm.c
+++ b/src/pulsecore/shm.c
@@ -27,12 +27,15 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/mman.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
#include <pulsecore/core-error.h>
#include <pulsecore/log.h>
#include <pulsecore/random.h>
@@ -51,6 +54,8 @@ static char *segment_name(char *fn, size_t l, unsigned id) {
return fn;
}
+#ifdef HAVE_SHM_OPEN
+
int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) {
char fn[32];
int fd = -1;
@@ -239,3 +244,21 @@ fail:
return -1;
}
+
+#else /* HAVE_SHM_OPEN */
+
+int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) {
+ return -1;
+}
+
+void pa_shm_free(pa_shm *m) {
+}
+
+void pa_shm_punch(pa_shm *m, size_t offset, size_t size) {
+}
+
+int pa_shm_attach_ro(pa_shm *m, unsigned id) {
+ return -1;
+}
+
+#endif /* HAVE_SHM_OPEN */