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

Commit 4efb5ecc authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

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

Merge "ashmem: Only use memfd if the kernel has ashmem-memfd compat support" into main am: 712feb76 am: c54dd3ca

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3433527



Change-Id: I0c4425952172532c8460fee8c874d09ecc72d336
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c8ba6aea c54dd3ca
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -132,6 +132,16 @@ static bool __has_memfd_support() {
        return false;
    }

    /*
     * Ensure that the kernel supports ashmem ioctl commands on memfds. If not,
     * fall back to using ashmem.
     */
    if (TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_SET_SIZE, getpagesize())) < 0) {
        ALOGE("ioctl(ASHMEM_SET_SIZE) failed: %s, no ashmem-memfd compat support.\n",
              strerror(errno));
        return false;
    }

    if (debug_log) {
        ALOGD("memfd: device has memfd support, using it\n");
    }