nix v0.18.0 Release Notes

Release Date: 2020-07-26 // over 3 years ago
  • ➕ Added

    • ➕ Added fchown(2) wrapper. (#1257)
    • Added support on linux systems for MAP_HUGE_SIZE family of flags. (#1211)
    • Added support for F_OFD_* fcntl commands on Linux and Android. (#1195)
    • ➕ Added env::clearenv(): calls libc::clearenv on platforms where it's available, and clears the environment of all variables via std::env::vars and std::env::remove_var on others. (#1185)
    • FsType inner value made public. (#1187)
    • ➕ Added unistd::setfsuid and unistd::setfsgid to set the user or group identity for filesystem checks per-thread. (#1163)
    • Derived Ord, PartialOrd for unistd::Pid (#1189)
    • ➕ Added select::FdSet::fds method to iterate over file descriptors in a set. (#1207)
    • ➕ Added support for UDP generic segmentation offload (GSO) and generic receive offload (GRO) (#1209)
    • ➕ Added support for sendmmsg and recvmmsg calls (#1208)
    • ➕ Added support for SCM_CREDS messages (UnixCredentials) on FreeBSD/DragonFly (#1216)
    • ➕ Added BindToDevice socket option (sockopt) on Linux (#1233)
    • Added EventFilter bitflags for EV_DISPATCH and EV_RECEIPT on OpenBSD. (#1252)
    • ➕ Added support for Ipv4PacketInfo and Ipv6PacketInfo to ControlMessage. (#1222)
    • 0️⃣ CpuSet and UnixCredentials now implement Default. (#1244)
    • ➕ Added unistd::ttyname (#1259)
    • ➕ Added support for Ipv4PacketInfo and Ipv6PacketInfo to ControlMessage for iOS and Android. (#1265)
    • ➕ Added support for TimerFd. (#1261)

    🔄 Changed

    • 🔄 Changed fallocate return type from c_int to () (#1201)
    • 🐧 Enabled sys::ptrace::setregs and sys::ptrace::getregs on x86_64-unknown-linux-musl target (#1198)
    • 🐧 On Linux, ptrace::write is now an unsafe function. Caveat programmer. (#1245)
    • execv, execve, execvp and execveat in ::nix::unistd and reboot in ::nix::sys::reboot now return Result<Infallible> instead of Result<Void> (#1239)
    • sys::socket::sockaddr_storage_to_addr is no longer unsafe. So is offset_of!.
    • sys::socket::sockaddr_storage_to_addr, offset_of!, and Errno::clear are no longer unsafe.
    • SockAddr::as_ffi_pair,sys::socket::sockaddr_storage_to_addr, offset_of!, and Errno::clear are no longer unsafe. (#1244)
    • Several Inotify methods now take self by value instead of by reference (#1244)
    • 📊 nix::poll::ppoll: timeout parameter is now optional, None is equivalent for infinite timeout.

    🛠 Fixed

    • 🛠 Fixed getsockopt. The old code produced UB which triggers a panic with Rust 1.44.0. (#1214)

    • 🛠 Fixed a bug in nix::unistd that would result in an infinite loop when a group or user lookup required a buffer larger than 16KB. (#1198)

    • Fixed unaligned casting of cmsg_data to af_alg_iv (#1206)

    • 🛠 Fixed readlink/readlinkat when reading symlinks longer than PATH_MAX (#1231)

    • PollFd, EpollEvent, IpMembershipRequest, Ipv6MembershipRequest, TimeVal, and IoVec are now repr(transparent). This is required for correctness's sake across all architectures and compilers, though now bugs have been reported so far. (#1243)

    • 🛠 Fixed unaligned pointer read in Inotify::read_events. (#1244)

    ✂ Removed

    • Removed sys::socket::addr::from_libc_sockaddr from the public API. (#1215)
    • Removed sys::termios::{get_libc_termios, get_libc_termios_mut, update_wrapper from the public API. These were previously hidden in the docs but still usable by downstream. (#1235)

    • Nix no longer implements NixPath for Option<P> where P: NixPath. Most Nix functions that accept NixPath arguments can't do anything useful with None. The exceptions (mount and quotactl_sync) already take explicitly optional arguments. (#1242)

    • ✂ Removed unistd::daemon and unistd::pipe2 on OSX and ios (#1255)

    • Removed sys::event::FilterFlag::NOTE_EXIT_REPARENTED and sys::event::FilterFlag::NOTE_REAP on OSX and ios. (#1255)

    • ✂ Removed sys::ptrace::ptrace on Android and Linux. (#1255)

    • ⬇️ Dropped support for powerpc64-unknown-linux-gnu (#1266)