message: journald: make `memfd_create` syscall directly
  Fixes
  ## Motivation
  `journald-tracing>=0.2.1` doesn't build with old glibc.
  ## Solution
  Make the `memfd_create` syscall ourselves.
  cc
diff: @@ -8,7 +8,7 @@ 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 = memfd_create_syscall(flags);
  if fd < 0 {
  Err(Error::last_os_error())
  } else {
  @@ -16,6 +16,22 @@ fn create(flags: c_uint) -> Result<File> {
  }
  }
  +/// Make the `memfd_create` syscall ourself instead of going through `libc`;
  +/// `memfd_create` isn't supported on `glibc<2.27` so this allows us to
  +/// support old-but-still-used distros like Ubuntu Xenial, Debian Stretch,
  +/// RHEL 7, etc.
  +///
  +/// See: https://github.com/tokio-rs/tracing/issues/1879
  +fn memfd_create_syscall(flags: c_uint) -> i64 {
  + unsafe {
  + syscall(
  + SYS_memfd_create,
  + "tracing-journald\0".as_ptr() as *const c_char,
  + flags,
  + )
  + }
  +}
  +
  pub fn create_sealable() -> Result<File> {
  create(MFD_ALLOW_SEALING | MFD_CLOEXEC)
  }
  