mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
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
This commit is contained in:
parent
568c8ea715
commit
10bbc4b7c9
3 changed files with 31 additions and 10 deletions
13
configure.ac
13
configure.ac
|
|
@ -144,7 +144,7 @@ AC_HEADER_STDC
|
||||||
# POSIX
|
# POSIX
|
||||||
AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \
|
AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \
|
||||||
netinet/in_systm.h netinet/ip.h netinet/tcp.h pwd.h sched.h \
|
netinet/in_systm.h netinet/ip.h netinet/tcp.h pwd.h sched.h \
|
||||||
sys/resource.h sys/select.h sys/socket.h sys/wait.h \
|
sys/mman.h sys/resource.h sys/select.h sys/socket.h sys/wait.h \
|
||||||
syslog.h])
|
syslog.h])
|
||||||
AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0])
|
AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0])
|
||||||
AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0])
|
AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0])
|
||||||
|
|
@ -202,12 +202,11 @@ AC_SEARCH_LIBS([pow], [m])
|
||||||
# POSIX
|
# POSIX
|
||||||
AC_SEARCH_LIBS([sched_setscheduler], [rt])
|
AC_SEARCH_LIBS([sched_setscheduler], [rt])
|
||||||
AC_SEARCH_LIBS([dlopen], [dl])
|
AC_SEARCH_LIBS([dlopen], [dl])
|
||||||
|
AC_SEARCH_LIBS([shm_open], [rt])
|
||||||
|
|
||||||
# BSD
|
# BSD
|
||||||
AC_SEARCH_LIBS([connect], [socket])
|
AC_SEARCH_LIBS([connect], [socket])
|
||||||
|
|
||||||
AC_SEARCH_LIBS([shm_open], [rt])
|
|
||||||
|
|
||||||
# Non-standard
|
# Non-standard
|
||||||
|
|
||||||
# This magic is needed so we do not needlessly add static libs to the win32
|
# This magic is needed so we do not needlessly add static libs to the win32
|
||||||
|
|
@ -221,8 +220,8 @@ AC_FUNC_FORK
|
||||||
AC_FUNC_GETGROUPS
|
AC_FUNC_GETGROUPS
|
||||||
AC_FUNC_SELECT_ARGTYPES
|
AC_FUNC_SELECT_ARGTYPES
|
||||||
AC_CHECK_FUNCS([chmod chown getaddrinfo getgrgid_r getpwuid_r gettimeofday \
|
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 posix_memalignsetpgid setsid \
|
||||||
sysconf])
|
shm_open sigaction sleep sysconf])
|
||||||
AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
|
AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
|
||||||
|
|
||||||
AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
|
AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
|
||||||
|
|
@ -243,10 +242,6 @@ AC_CHECK_FUNCS([lstat])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([setresuid setresgid setreuid setregid seteuid setegid])
|
AC_CHECK_FUNCS([setresuid setresgid setreuid setregid seteuid setegid])
|
||||||
|
|
||||||
# Memory mangement
|
|
||||||
|
|
||||||
AC_CHECK_FUNCS([mmap posix_memalign madvise])
|
|
||||||
|
|
||||||
#### POSIX threads ####
|
#### POSIX threads ####
|
||||||
|
|
||||||
ACX_PTHREAD
|
ACX_PTHREAD
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,10 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_MMAN_H
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <pulse/xmalloc.h>
|
#include <pulse/xmalloc.h>
|
||||||
#include <pulse/util.h>
|
#include <pulse/util.h>
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,15 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_MMAN_H
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <pulsecore/core-error.h>
|
#include <pulsecore/core-error.h>
|
||||||
#include <pulsecore/log.h>
|
#include <pulsecore/log.h>
|
||||||
#include <pulsecore/random.h>
|
#include <pulsecore/random.h>
|
||||||
|
|
@ -51,6 +54,8 @@ static char *segment_name(char *fn, size_t l, unsigned id) {
|
||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SHM_OPEN
|
||||||
|
|
||||||
int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) {
|
int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) {
|
||||||
char fn[32];
|
char fn[32];
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
|
|
@ -239,3 +244,21 @@ fail:
|
||||||
|
|
||||||
return -1;
|
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 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue