Skip to content
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

Make memfd_create syscall directly #1912

Merged
merged 4 commits into from
Feb 7, 2022
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion tracing-journald/src/memfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ use std::os::raw::c_uint;
use std::os::unix::prelude::{FromRawFd, RawFd};

fn create(flags: c_uint) -> Result<File> {
let fd = unsafe { memfd_create("tracing-journald\0".as_ptr() as *const c_char, flags) };
let fd = unsafe {
9999years marked this conversation as resolved.
Show resolved Hide resolved
syscall(
9999years marked this conversation as resolved.
Show resolved Hide resolved
SYS_memfd_create,
"tracing-journald\0".as_ptr() as *const c_char,
flags,
)
};
if fd < 0 {
Err(Error::last_os_error())
} else {
Expand Down