[pulseaudio-commits] r1316 - in /trunk: configure.ac src/modules/module-oss-mmap.c src/pulsecore/shm.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Tue Aug 22 04:41:15 PDT 2006


Author: ossman
Date: Tue Aug 22 13:41:14 2006
New Revision: 1316

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1316&root=pulseaudio&view=rev
Log:
Fix detection of shared memory support and proper fallback.

Modified:
    trunk/configure.ac
    trunk/src/modules/module-oss-mmap.c
    trunk/src/pulsecore/shm.c

Modified: trunk/configure.ac
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/configure.ac?rev=1316&root=pulseaudio&r1=1315&r2=1316&view=diff
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Aug 22 13:41:14 2006
@@ -144,7 +144,7 @@
 # POSIX
 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 \
-    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])
 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])
@@ -202,11 +202,10 @@
 # POSIX
 AC_SEARCH_LIBS([sched_setscheduler], [rt])
 AC_SEARCH_LIBS([dlopen], [dl])
+AC_SEARCH_LIBS([shm_open], [rt])
 
 # BSD
 AC_SEARCH_LIBS([connect], [socket])
-
-AC_SEARCH_LIBS([shm_open], [rt])
 
 # Non-standard
 
@@ -221,8 +220,8 @@
 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 \
-    sysconf])
+    getuid inet_ntop inet_pton nanosleep pipe posix_memalignsetpgid setsid \
+    shm_open sigaction sleep sysconf])
 AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
 
 AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
@@ -242,10 +241,6 @@
 # Non-standard
 
 AC_CHECK_FUNCS([setresuid setresgid setreuid setregid seteuid setegid])
-
-# Memory mangement
-
-AC_CHECK_FUNCS([mmap posix_memalign madvise])
 
 #### POSIX threads ####
 

Modified: trunk/src/modules/module-oss-mmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss-mmap.c?rev=1316&root=pulseaudio&r1=1315&r2=1316&view=diff
==============================================================================
--- trunk/src/modules/module-oss-mmap.c (original)
+++ trunk/src/modules/module-oss-mmap.c Tue Aug 22 13:41:14 2006
@@ -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>

Modified: trunk/src/pulsecore/shm.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/shm.c?rev=1316&root=pulseaudio&r1=1315&r2=1316&view=diff
==============================================================================
--- trunk/src/pulsecore/shm.c (original)
+++ trunk/src/pulsecore/shm.c Tue Aug 22 13:41:14 2006
@@ -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>
@@ -50,6 +53,8 @@
     snprintf(fn, l, "/pulse-shm-%u", 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];
@@ -239,3 +244,21 @@
 
     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 */




More information about the pulseaudio-commits mailing list