mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 13:53:11 +00:00
use SYS_openat when available
some architecture like AArch64 may not have the open syscall, but have openat syscall. so check and use SYS_openat if SYS_openat available if SYS_open is not supported at init_thp_state.
This commit is contained in:
@@ -563,6 +563,9 @@ init_thp_state(void) {
|
|||||||
#if defined(JEMALLOC_USE_SYSCALL) && defined(SYS_open)
|
#if defined(JEMALLOC_USE_SYSCALL) && defined(SYS_open)
|
||||||
int fd = (int)syscall(SYS_open,
|
int fd = (int)syscall(SYS_open,
|
||||||
"/sys/kernel/mm/transparent_hugepage/enabled", O_RDONLY);
|
"/sys/kernel/mm/transparent_hugepage/enabled", O_RDONLY);
|
||||||
|
#elif defined(JEMALLOC_USE_SYSCALL) && defined(SYS_openat)
|
||||||
|
int fd = (int)syscall(SYS_openat,
|
||||||
|
AT_FDCWD, "/sys/kernel/mm/transparent_hugepage/enabled", O_RDONLY);
|
||||||
#else
|
#else
|
||||||
int fd = open("/sys/kernel/mm/transparent_hugepage/enabled", O_RDONLY);
|
int fd = open("/sys/kernel/mm/transparent_hugepage/enabled", O_RDONLY);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user