nix v0.16.0 Release Notes

Release Date: 2019-12-02 // over 4 years ago
  • ➕ Added

    • ➕ Added ptrace::seize(): similar to attach() on Linux but with better-defined semantics. (#1154)

    • ➕ Added Signal::as_str(): returns signal name as &'static str (#1138)

    • ➕ Added posix_fallocate. (#1105)

    • 0️⃣ Implemented Default for FdSet (#1107)

    • ➕ Added NixPath::is_empty. (#1107)

    • ➕ Added mkfifoat (#1133)

    • Added User::from_uid, User::from_name, User::from_gid and Group::from_name, (#1139)

    • ➕ Added linkat (#1101)

    • ➕ Added sched_getaffinity. (#1148)

    • ➕ Added optional Signal argument to ptrace::{detach, syscall} for signal injection. (#1083)

    🔄 Changed

    • sys::termios::BaudRate now implements TryFrom<speed_t> instead of From<speed_t>. The old From implementation would panic on failure. (#1159)

    • sys::socket::ControlMessage::ScmCredentials and sys::socket::ControlMessageOwned::ScmCredentials now wrap UnixCredentials rather than libc::ucred. (#1160)

    • sys::socket::recvmsg now takes a plain Vec instead of a CmsgBuffer implementor. If you were already using cmsg_space!, then you needn't worry. (#1156)

    • sys::socket::recvfrom now returns Result<(usize, Option<SockAddr>)> instead of Result<(usize, SockAddr)>. (#1145)

    • Signal::from_c_int has been replaced by Signal::try_from (#1113)

    • 🔄 Changed readlink and readlinkat to return OsString (#1109)

      # use nix::fcntl::{readlink, readlinkat};
      // the buffer argument of `readlink` and `readlinkat` has been removed,
      // and the return value is now an owned type (`OsString`).
      // Existing code can be updated by removing the buffer argument
      // and removing any clone or similar operation on the output
    
      // old code `readlink(&path, &mut buf)` can be replaced with the following
      let _: OsString = readlink(&path);
    
      // old code `readlinkat(dirfd, &path, &mut buf)` can be replaced with the following
      let _: OsString = readlinkat(dirfd, &path);
    
    • 👍 Minimum supported Rust version is now 1.36.0. (#1108)

    • Ipv4Addr::octets, Ipv4Addr::to_std, Error::as_errno, ForkResult::is_child, ForkResult::is_parent, Gid::as_raw, Uid::is_root, Uid::as_raw, Pid::as_raw, and PollFd::revents now take self by value. (#1107)

    • Type &CString for parameters of exec(v|ve|vp|vpe|veat) are changed to &CStr. (#1121)

    🛠 Fixed

    • 🛠 Fix length of abstract socket addresses (#1120)

    • 🛠 Fix initialization of msghdr in recvmsg/sendmsg when built with musl (#1136)

    ✂ Removed

    • ✂ Remove the deprecated CmsgSpace. (#1156)