diff options
Diffstat (limited to 'src/pulsecore')
-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 */ |