Skip to content

Commit 28f4487

Browse files
authored
Merge pull request #701 from lslusarczyk/fix-syscall_memfd_secret
Fix compilation of syscall_memfd_secret for SLES
2 parents 89b660c + 72e22a9 commit 28f4487

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/provider/provider_os_memory_linux.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ static int syscall_memfd_secret(void) {
8080
int fd = -1;
8181
#ifdef __NR_memfd_secret
8282
// SYS_memfd_secret is supported since Linux 5.14
83-
fd = syscall(SYS_memfd_secret, 0);
83+
// not using SYS_memfd_secret as SLES does not define it
84+
fd = syscall(__NR_memfd_secret, 0);
8485
if (fd == -1) {
8586
LOG_PERR("memfd_secret() failed");
8687
}
@@ -95,7 +96,8 @@ static int syscall_memfd_create(void) {
9596
int fd = -1;
9697
#ifdef __NR_memfd_create
9798
// SYS_memfd_create is supported since Linux 3.17, glibc 2.27
98-
fd = syscall(SYS_memfd_create, "anon_fd_name", 0);
99+
// not using SYS_memfd_create for consistency with syscall_memfd_secret
100+
fd = syscall(__NR_memfd_create, "anon_fd_name", 0);
99101
if (fd == -1) {
100102
LOG_PERR("memfd_create() failed");
101103
}

0 commit comments

Comments
 (0)