Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f518d466 authored by Isaac J. Manjarres's avatar Isaac J. Manjarres Committed by Isaac Manjarres
Browse files

ashmem: Only use memfd if the kernel has ashmem-memfd compat support



There are still old applications that have not migrated to using
libcutils, and allocate shared memory buffers by directly allocating
them from "/dev/ashmem", and then using the ashmem ioctl commands
to operate on the buffer.

This works well on a system where all shared memory buffers are ashmem
buffers. However, in a system where there could be a mix of ashmem and
memfd buffers (e.g. if sys.use_memfd == true), this could be a problem
as ashmem ioctl commands on memfds will fail if the kernel does not
have support for ashmem-memfd compatibility.

Therefore, check for ashmem-memfd compatiblity before deciding if memfd
is usable.

Bug: 111903542
Change-Id: I760e57b31b53cdd4cfbf94cb35a6fb47b089bb1b
Signed-off-by: default avatarIsaac J. Manjarres <isaacmanjarres@google.com>
parent 20f62340
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment