Skip to content

Fix compilation of syscall_memfd_secret for SLES #701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/provider/provider_os_memory_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ static int syscall_memfd_secret(void) {
int fd = -1;
#ifdef __NR_memfd_secret
// SYS_memfd_secret is supported since Linux 5.14
fd = syscall(SYS_memfd_secret, 0);
// not using SYS_memfd_secret as SLES does not define it
fd = syscall(__NR_memfd_secret, 0);
if (fd == -1) {
LOG_PERR("memfd_secret() failed");
}
Expand All @@ -95,7 +96,8 @@ static int syscall_memfd_create(void) {
int fd = -1;
#ifdef __NR_memfd_create
// SYS_memfd_create is supported since Linux 3.17, glibc 2.27
fd = syscall(SYS_memfd_create, "anon_fd_name", 0);
// not using SYS_memfd_create for consistency with syscall_memfd_secret
fd = syscall(__NR_memfd_create, "anon_fd_name", 0);
if (fd == -1) {
LOG_PERR("memfd_create() failed");
}
Expand Down
Loading