diff options
author | Ahmed S. Darwish <darwish.07@gmail.com> | 2016-03-13 01:04:18 +0200 |
---|---|---|
committer | David Henningsson <david.henningsson@canonical.com> | 2016-04-02 05:47:47 +0200 |
commit | 73e86b1cb164b1c37b27238b529879a4a2d9f24c (patch) | |
tree | c59a687ab83a9dd07e668cb79d5605dd9470e0df /configure.ac | |
parent | 1c3a2bcaf17014ad81e0d6bc61ca42c477de1140 (diff) | |
download | pulseaudio-73e86b1cb164b1c37b27238b529879a4a2d9f24c.tar.gz |
pulsecore: Introduce memfd support
Memfd is a simple memory sharing mechanism, added by the systemd/kdbus
developers, to share pages between processes in an anonymous, no global
registry needed, no mount-point required, relatively secure, manner.
This patch introduces the necessary building blocks for using memfd
shared memory transfers in PulseAudio.
Memfd support shall also help us in laying out the necessary (but not
yet sufficient) groundwork for application sandboxing, protecting PA
from its clients, and protecting clients data from each other.
We plan to exclusively use memfds, instead of POSIX SHM, on the way
forward.
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 8454e4cf0..ee64988c7 100644 --- a/configure.ac +++ b/configure.ac @@ -612,6 +612,23 @@ AC_DEFINE(HAVE_DLADDR, [1], [Have dladdr?]) AM_ICONV +#### Linux memfd_create(2) SHM support #### + +AC_ARG_ENABLE([memfd], + AS_HELP_STRING([--disable-memfd], [Disable Linux memfd shared memory])) + +AS_IF([test "x$enable_memfd" != "xno"], + AC_CHECK_DECL(SYS_memfd_create, [HAVE_MEMFD=1], [HAVE_MEMFD=0], [#include <sys/syscall.h>]), + [HAVE_MEMFD=0]) + +AS_IF([test "x$enable_memfd" = "xyes" && test "x$HAVE_MEMFD" = "x0"], + [AC_MSG_ERROR([*** Your Linux kernel does not support memfd shared memory. + *** Use linux v3.17 or higher for such a feature.])]) + +AC_SUBST(HAVE_MEMFD) +AM_CONDITIONAL([HAVE_MEMFD], [test "x$HAVE_MEMFD" = x1]) +AS_IF([test "x$HAVE_MEMFD" = "x1"], AC_DEFINE([HAVE_MEMFD], 1, [Have memfd shared memory.])) + #### X11 (optional) #### AC_ARG_ENABLE([x11], @@ -1549,6 +1566,7 @@ AC_OUTPUT # ========================================================================== +AS_IF([test "x$HAVE_MEMFD" = "x1"], ENABLE_MEMFD=yes, ENABLE_MEMFD=no) AS_IF([test "x$HAVE_X11" = "x1"], ENABLE_X11=yes, ENABLE_X11=no) AS_IF([test "x$HAVE_OSS_OUTPUT" = "x1"], ENABLE_OSS_OUTPUT=yes, ENABLE_OSS_OUTPUT=no) AS_IF([test "x$HAVE_OSS_WRAPPER" = "x1"], ENABLE_OSS_WRAPPER=yes, ENABLE_OSS_WRAPPER=no) @@ -1610,6 +1628,7 @@ echo " CPPFLAGS: ${CPPFLAGS} LIBS: ${LIBS} + Enable memfd shared memory: ${ENABLE_MEMFD} Enable X11: ${ENABLE_X11} Enable OSS Output: ${ENABLE_OSS_OUTPUT} Enable OSS Wrapper: ${ENABLE_OSS_WRAPPER} |