Skip to content

Commit 7ebc0bc

Browse files
committed
Implement memfd with a raw syscall for compat with old glibc
1 parent 89b4976 commit 7ebc0bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sys/memfd.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ pub fn memfd_create(name: &CStr, flags: MemFdCreateFlag) -> Result<OwnedFd> {
4949
any(
5050
target_os = "freebsd",
5151
// If the OS is Linux, gnu and musl expose a memfd_create symbol but not uclibc
52-
target_env = "gnu",
52+
// *but* the glibc symbol was only added in 2.27, so for compatability with
53+
// older systems we use the raw syscall on target_env = "gnu".
5354
target_env = "musl",
5455
)))]
5556
{

0 commit comments

Comments
 (0)