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: Isaac J. Manjarres <isaacmanjarres@google.com>
1 file changed