Skip to content

Commit a5d0fc3

Browse files
authored
Merge pull request #2049 from saethlin/memfd_create
Add #[inline] to memfd_create to delay codegen and prevent undefined symbols in dylibs
2 parents 1fbc897 + ca49cd8 commit a5d0fc3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/sys/memfd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ libc_bitflags!(
4040
/// For more information, see [`memfd_create(2)`].
4141
///
4242
/// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html
43+
#[inline] // Delays codegen, preventing linker errors with dylibs and --no-allow-shlib-undefined
4344
pub fn memfd_create(name: &CStr, flags: MemFdCreateFlag) -> Result<OwnedFd> {
4445
let res = unsafe {
4546
cfg_if! {

0 commit comments

Comments
 (0)