diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-08-22 11:41:14 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-08-22 11:41:14 +0000 |
commit | 10bbc4b7c9e6aed6e0b281eaf23b8192e53233d7 (patch) | |
tree | b19bf6b3b1b887a6d6ea05c9955badb019c83f29 /src/pulsecore/shm.c | |
parent | 568c8ea7158d3f94793f27768afbd639558a932f (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/pulsecore/shm.c')
-rw-r--r-- | src/pulsecore/shm.c | 25 |
1 files changed, 24 insertions, 1 deletions
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 */ |