Revert "ART: Add version check for memfd_create()"
* This check is redundant as devices that lack
the memfd_create syscall will fail to boot
regardless of the check.
This reverts commit 51f89d9b465e34fb18a5704c6dfe885ebad817d0.
Change-Id: Ife2cebde713e14bd787f48628092650866e2ac09
(cherry picked from commit dc32b857d57a2a431746e87027272b514dd94fcf)
diff --git a/libartbase/base/memfd.cc b/libartbase/base/memfd.cc
index 780be32..e57c948 100644
--- a/libartbase/base/memfd.cc
+++ b/libartbase/base/memfd.cc
@@ -17,10 +17,8 @@
#include "memfd.h"
#include <errno.h>
-#include <stdio.h>
#if !defined(_WIN32)
#include <sys/syscall.h>
-#include <sys/utsname.h>
#include <unistd.h>
#endif
@@ -41,20 +39,6 @@
#if defined(__NR_memfd_create)
int memfd_create(const char* name, unsigned int flags) {
- // Check kernel version supports memfd_create(). Some older kernels segfault executing
- // memfd_create() rather than returning ENOSYS (b/116769556).
- static constexpr int kRequiredMajor = 3;
- static constexpr int kRequiredMinor = 17;
- struct utsname uts;
- int major, minor;
- if (uname(&uts) != 0 ||
- strcmp(uts.sysname, "Linux") != 0 ||
- sscanf(uts.release, "%d.%d", &major, &minor) != 2 ||
- (major < kRequiredMajor || (major == kRequiredMajor && minor < kRequiredMinor))) {
- errno = ENOSYS;
- return -1;
- }
-
return syscall(__NR_memfd_create, name, flags);
}
diff --git a/libartbase/base/memfd.h b/libartbase/base/memfd.h
index 91db0b2..4367198 100644
--- a/libartbase/base/memfd.h
+++ b/libartbase/base/memfd.h
@@ -19,8 +19,7 @@
namespace art {
-// Call memfd(2) if available on platform and return result. This call also makes a kernel version
-// check for safety on older kernels (b/116769556)..
+ // Call memfd(2) if available on platform and return result.
int memfd_create(const char* name, unsigned int flags);
} // namespace art