nix
Rust friendly bindings to *nix APIs
0.31.3
742M downloads/mo
#105 most downloaded on crates.io
nix-rust/nix
What this package is like to depend on
Last release 3 months ago
11 May 2026
Release timing varies
gaps range from 4 weeks to 11 months
Rarely documented
notes for 10 of 77 stable releases
2 versions withdrawn
withdrawn after publishing
12 years old
79 releases · first in 2014
4 releases in the last 12 months
see the full history below
Release timeline
79 releases · Nov 2014 to May 2026Releases
latest 60 of 79-
0.31.311 May 2026Release notes
Open source →Added
- Enable module
ioctlfor Cygwin (#2715) - Add
CLOCK_BOOTTIME/CLOCK_PROCESS_CPUTIME_ID/CLOCK_THREAD_CPUTIME_ID/CLOCK_UPTIMEto NetBSD-like platforms (#2716) - unistd: add mkfifo for redox (#2749)
- Added
kevent64support on apple targets:Kqueue::kevent64,KEvent64, andKevent64Flags. (#2781)
Fixed
- fix SaFlags_t definition on redox (#2751)
- Fixed
EpollEvent::events()to usefrom_bits_retaininstead offrom_bits().unwrap(), preventing panics when the kernel returns unknown epoll flags. (#2783) - Fixed
KEvent::flags()andKEvent::fflags()to usefrom_bits_retaininstead offrom_bits().unwrap(), preventing panics when the kernel returns unknown kqueue flags. (#2784)
- Enable module
-
0.31.228 Feb 2026Release notes
Open source →Added
- Add WatchDescriptor::as_raw, to get libc id of WatchDescriptor. (#2718)
- Added process::pthread_getthreadid_np() on FreeBSD. (#2725)
- Added timerfd support on FreeBSD (#2728)
Fixed
- The libc requirement is now
0.2.181, rather than pinned to 0.2.180. (#2744)
-
0.31.123 Jan 2026 -
0.31.022 Jan 2026Release notes
Open source →Added
-
Added the UDP GSO/GRO socket options and CMsgs on Android. This includes the following types:
- UdpGsoSegment
- UdpGroSegment
- ControlMessage::UdpGsoSegments
- ControlMessageOwned::UdpGroSegments
(#2666)
-
Define errno EWOULDBLOCK as an alias of EAGAIN to match the AIX libc definition. (#2692)
-
Enable module
ifaddrson GNU Hurd (#2697) -
Add termios
OutputFlags::OFILLfor Linux, Android, Aix, Cygwin, Fuchsia, Haiku, GNU/Hurd, Nto, Redox, Illumos, Solaris and Apple OSes. (#2701) -
add sync() for cygwin (#2708)
Changed
Fixed
- Fixed
nix::sys::ptrace::syscall_info, which was not setting thedataargument properly, causing garbage values to be returned. (#2653) - Cast the 'addr' argument of 'madvise()' to '*mut u8' on AIX to match the signature in the AIX libc. (#2655)
- Fixed the Dir module on NTO, Solaris, Hurd, and possibly other platforms. The d_name field was not copied correctly on those platforms. For some other platforms, it could be copied incorrectly for files with very long pathnames. (#2674)
- Fix the build on Illumos (#2694)
Removed
- Removed
EqandPartialEqimplementations fromSigHandler, because they never worked reliably. The suggested alternative ismatches!. For example:let h: SigHandler = ... if matches!(h, SigHandler::SigIgn) { ... } ``` ([#2642](https://github.com/nix-rust/nix/pull/2642)) - Removed
IFF_NOTRAILERSby NetBSD, as it has been removed upstream and from libc (#2724)
-
-
0.30.104 May 2025 -
0.30.029 Apr 2025Release notes
Open source →Added
- Add socket option
IPV6_PKTINFOfor BSDs/Linux/Android, alsoIPV6_RECVPKTINFOfor DragonFlyBSD (#2113) - Add
fcntl'sF_PREALLOCATEconstant for Apple targets. (#2393) - Improve support for extracting the TTL / Hop Limit from incoming packets and support for DSCP (ToS / Traffic Class). (#2425)
- Add socket option IP_TOS (nix::sys::socket::sockopt::IpTos) IPV6_TCLASS (nix::sys::socket::sockopt::Ipv6TClass) on Android/FreeBSD (#2464)
- Add
SeekDataandSeekHoletoWhencefor hurd and apple targets (#2473) - Add
Fromtrait implementation betweenSocketAddrandSockaddr,Sockaddr6(#2474) - Added wrappers for
posix_spawnAPI (#2475) - Add the support for Emscripten. (#2477)
- Add fcntl constant
F_RDADVISEfor Apple target (#2480) - Add fcntl constant
F_RDAHEADfor Apple target (#2482) - Add
F_LOG2PHYSandF_LOG2PHYS_EXTfor Apple target (#2483) MAP_SHARED_VALIDATEwas added for all linux targets. &MAP_SYNCwas added for linux with the exclusion of mips architecures, and uclibc (#2499)- Add
getregs()/getregset()/setregset()for Linux/musl/aarch64 (#2502) - Add FcntlArgs
F_TRANSFEREXTENTSconstant for Apple targets (#2504) - Add
MapFlags::MAP_STACKinsys::manfor netbsd (#2526) - Add support for
libc::LOCAL_PEERTOKENingetsockopt. (#2529) - Add support for
syslog,openlog,closelogon allunix. (#2537) - Add the
TCP_FUNCTION_BLKsockopt, on FreeBSD. (#2539) - Implements
Into<OwnedFd>forPtyMaster/Fanotify/Inotify/SignalFd/TimerFd(#2548) - Add
MremapFlags::MREMAP_DONTUNMAPtosys::mman::mremapfor linux target. (#2555) - Added
sockopt_impl!to the public API. It's now possible for users to define their own sockopts without needing to make a PR to Nix. (#2556) - Add the
TCP_FUNCTION_ALIASsockopt, on FreeBSD. (#2558) - Add
sys::mman::MmapAdviseMADV_PAGEOUT,MADV_COLD,MADV_WIPEONFORK,MADV_KEEPONFORKfor Linux and Android targets (#2559) - Add socket protocol
Sctp, as well asMSG_NOTIFICATIONfor non-Android Linux targets. (#2562) - Added
from_owned_fdconstructor toEventFd(#2563) - Add
sys::mman::MmapAdviseMADV_POPULATE_READ,MADV_POPULATE_WRITEfor Linux and Android targets (#2565) - Added
from_owned_fdconstructor toPtyMaster/Fanotify/Inotify/SignalFd/TimerFd(#2566) - Added
FcntlArg::F_READAHEADfor FreeBSD target (#2569) - Added
sockopt::LingerSecfor Apple targets (#2572) - Added
sockopt::EsclBindfor solarish targets (#2573) - Exposed the
std::os::fd::AsRawFdtrait method fornix::sys::fanotify::Fanotifystruct (#2575) - Add support for syslog's
setlogmaskon allunix. (#2579) - Added Fuchsia support for
ioctl. (#2580) - Add
sys::socket::SockProtocol::EthIp,sys::socket::SockProtocol::EthIpv6,sys::socket::SockProtocol::EthLoop(#2581) - Add OpenHarmony target into CI and Update documents. (#2599)
- Added the TcpMaxSeg
setsockoptoption for apple targets (#2603) - Add
FilAttachandFilDetachto socket::sockopt for Illumos (#2611) - Add
PeerPidfd(SO_PEERPIDFD) tosocket::sockoptfor Linux (#2620) - Added
socket::sockopt::AttachReusePortCbpffor Linux (#2621) - Add
ptrace::syscall_infofor linux/glibc (#2627)
Changed
- Module sys/signal now adopts I/O safety (#1936)
- Change the type of the
nameargument ofmemfd_create()from&CStrto<P: NixPath>(name: &P)(#2431) - Public interfaces in
fcntl.rsanddir.rsnow use I/O-safe types. (#2434) - Module
sys/statnow adopts I/O safety. (#2439) - Module unistd now adopts I/O safety. (#2440)
- Module sys/fanotify now adopts I/O safety (#2443)
- Socket option
IpToshas been renamed toIpv4Tos, the old symbol is deprecated since 0.30.0 (#2465) - Rename Flags
EventFlagtoEvFlags, andMemFdCreateFlagtoMFdFlags(#2476) - Made
nix::sys::socket::UnknownCmsgpublic and more readable (#2520) - recvmsg: take slice for cmsg_buffer instead of Vec (#2524)
- linkat: allow distinct types for path arguments (#2582)
Fixed
- Disable unsupported signals on sparc-linux (#2454)
- Fix cmsg_len() return type on OpenHarmony (#2456)
- The
nsargument ofsys::prctl::set_timerslack()should be of typec_ulong(#2505) - Properly exclude NUL characters from
OSStrings returned bygetsockopt. (#2557) - Fixes the build on OpenHarmony (#2587)
Removed
- Type
SigevNotifyis no longerPartialEq,EqandHashdue to the use ofBorrowedFd(#1936) EventFd::defuse()is removed because it does nothing,EventFd::arm()is also removed for symmetry reasons. (#2452)- Removed the
Copytrait fromPollFd(#2631)
[0.29.0] - 2024-05-24
Added
- Add
getregset()/setregset()for Linux/glibc/x86/x86_64/aarch64/riscv64 andgetregs()/setregs()for Linux/glibc/aarch64/riscv64 (#2044) - Add socket option Ipv6Ttl for apple targets. (#2287)
- Add socket option UtunIfname. (#2325)
- make SigAction repr(transparent) & can be converted to the libc raw type (#2326)
- Add
Fromtrait implementation for conversions betweensockaddr_inandSockaddrIn,sockaddr_in6andSockaddrIn6(#2328) - Add socket option ReusePortLb for FreeBSD. (#2332)
- Added support for openat2 on linux. (#2339)
- Add if_indextoname function. (#2340)
- Add
mountandunmountAPI for apple targets. (#2347) - Added
_PC_MIN_HOLE_SIZEforpathconfandfpathconf. (#2349) - Added
impl AsFd for pty::PtyMaster(#2355) - Add
openflagO_SEARCHto AIX, Empscripten, FreeBSD, Fuchsia, solarish, WASI (#2374) - Add prctl function
prctl_set_vma_anon_namefor Linux/Android. (#2378) - Add
sync(2)forapple_targets/solarish/haiku/aix/hurd,syncfs(2)forhurdandfdatasync(2)foraix/hurd(#2379) - Add fdatasync support for Apple targets. (#2380)
- Add
fcntl::OFlag::O_PATHfor FreeBSD and Fuchsia (#2382) - Added
PathconfVar::MIN_HOLE_SIZEfor apple_targets. (#2388) - Add
openflagO_SEARCHto apple_targets (#2391) O_DSYNCmay now be used withaio_fsyncandfcntlon FreeBSD. (#2404)- Added
Flock::relockfor upgrading and downgrading locks. (#2407)
Changed
-
Change the
ForkptyResulttype to the following repr so that the uninitializedmasterfield won't be accessed in the child process:pub enum ForkptyResult { Parent { child: Pid, master: OwnedFd, }, Child, } ``` ([#2315](https://github.com/nix-rust/nix/pull/2315)) -
Updated
cfg_aliasesdependency from version 0.1 to 0.2 (#2322) -
Change the signature of
ptrace::writeandptrace::write_userto make them safe (#2324) -
Allow use of
SignalFdthrough shared referenceLike with many other file descriptors, concurrent use of signalfds is safe. Changing the signal mask of and reading signals from a signalfd can now be done with the
SignalFdAPI even if other references to it exist. (#2367) -
Changed tee, splice and vmsplice RawFd arguments to AsFd. (#2387)
-
Added I/O safety to the sys/aio module. Most functions that previously accepted a
AsRawFdargument now accept anAsFdinstead. (#2401) -
RecvMsg::cmsgs()now returns aResult, and checks that cmsgs were not truncated. (#2413)
Fixed
- No longer panics when the
fanotifyqueue overflows. (#2399) - Fixed ControlMessageOwned::UdpGroSegments wrapped type from u16 to i32 to reflect the used kernel's one. (#2406)
[0.28.0] - 2024-02-24
Added
-
Added
mkdtempwrapper (#1297) -
Add associated constants
UTIME_OMITUTIME_NOWforTimeSpec(#1879) -
Added
EventFdtype. (#1945) -
- Added
impl From<Signal> for SigSet. - Added
impl std::ops::BitOr for SigSet. - Added
impl std::ops::BitOr for Signal. - Added
impl std::ops::BitOr<Signal> for SigSet
(#1959)
- Added
-
Added
TlsGetRecordTypecontrol message type and corresponding enum for linux (#2065) -
Added
Ipv6HopLimitto::nix::sys::socket::ControlMessagefor Linux, MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku. (#2074) -
Added
IcmpandIcmpV6toSockProtocol(#2103) -
Added rfork support for FreeBSD in
unistd(#2121) -
Added
MapFlags::map_hugetlb_with_size_log2method for Linux targets (#2125) -
Added
mmap_anonymousfunction (#2127) -
Added
mips32r6andmips64r6support for signal, ioctl and ptrace (#2138) -
Added
F_GETPATHFcntlFlags entry on Apple/NetBSD/DragonflyBSD for::nix::fcntl. (#2142) -
Added
F_KINFOFcntlFlags entry on FreeBSD for::nix::fcntl. (#2152) -
Added
F_GETPATH_NOFIRMLINKandF_BARRIERFSYNCFcntlFlags entry on Apple for::nix::fcntl. (#2155) -
Added newtype
Flockto automatically unlock a held flock upon drop. AddedFlockabletrait to represent valid types forFlock. (#2170) -
Added
SetSockOptimpls to enable Linux Kernel TLS on a TCP socket and to import TLS parameters. (#2175) -
- Added the
::nix::sys::socket::SocketTimestampenum for configuring theTsClock(a.k.aSO_TS_CLOCK) sockopt - Added FreeBSD's
ScmRealtimeandScmMonotonicas new options in::nix::sys::socket::ControlMessageOwned
(#2187)
- Added the
-
Added new fanotify API: wrappers for
fanotify_initandfanotify_mark(#2194) -
Added
SpecialCharacterindicessupport for haiku. (#2195) -
Added
sys::sendfilesupport for solaris/illumos. (#2198) -
impl Display for InterfaceFlags (#2206)
-
Added
sendfilevin sys::sendfile for solarish (#2207) -
Added
fctrl::SealFlag::F_SEAL_FUTURE_WRITE(#2213) -
Added
Ipv6MulticastHopsas socket option to set and read. (#2234) -
Enable
ControlMessageOwned::Ipv4RecvIfandControlMessageOwned::Ipv4RecvDstAddrfor DragonFlyBSD (#2240) -
ClockId::set_time()andtime::clock_settime()are now enabled on macOS (#2241) -
Added
IpBindAddressNoPortsockopt to supportIP_BIND_ADDRESS_NO_PORTavailable on linux. (#2244) -
Enable
MapFlags::map_hugetlb_with_size_log2method for Android/Fuchsia (#2245) -
Added
TcpFastOpenConnectsockopt to supportTCP_FASTOPEN_CONNECTavailable on linux. (#2247) -
Add
reboot(2)for OpenBSD/NetBSD (#2251) -
Added new
MemFdCreateFlagconstants tosys::memfdon Linux and Android related to hugetlbfs support. (#2252) -
Expose the inner fd of
Kqueuethrough:- impl AsFd for Kqueue
- impl From<Kqueue> for OwnedFd
(#2258)
-
Added
sys::eventfdsupport on FreeBSD (#2259) -
Added
MmapFlags::MAP_FIXEDconstant insys::mmanfor netbsd and openbsd (#2260) -
Added the
SO_LISTENQLIMITsockopt. (#2263) -
Enable the
AT_EMPTY_PATHflag for thefchownat()function (#2267) -
Add
AtFlags::AT_EMPTY_PATHfor FreeBSD and Hurd (#2270) -
Enable `OFlag::O_DIRECTORY for Solarish (#2275)
-
Added the
Backlogwrapper type for thelistencall. (#2276) -
Add
clock_nanosleep()(#2277) -
Enabled
O_DIRECTinfcntl::OFlagsfor solarish (#2278) -
Added a new API sigsuspend. (#2279)
-
- Added
errno::Errno::setfunction - Added
errno::Errno::set_rawfunction - Added
errno::Errno::last_rawfunction - Added
errno::Errno::from_rawfunction
(#2283)
- Added
-
Enable the
AT_EMPTY_PATHflag for thelinkat()function (#2284) -
Enable unistd::{sync, syncfs} for Android (#2296)
Changed
-
pollnow takesPollTimeoutreplacinglibc::c_int. (#1876) -
Deprecated
sys::eventfd::eventfd. (#1945) -
mmap,mmap_anonymous,munmap,mremap,madvise,msync,mprotect,munlockandmlockupdated to useNonNull. (#2000) -
mmapfunction now acceptsFinstead ofOption<F>(#2127) -
PollFd::newnow takes aBorrowedFdargument, with relaxed lifetime requirements relative to the previous version. (#2134) -
FdSet::{insert, remove, contains}now takeBorrowedFdarguments, and have relaxed lifetime requirements relative to 0.27.1. (#2136) -
The following APIs now take an implementation of
AsFdrather than aRawFd:unistd::tcgetpgrpunistd::tcsetpgrpunistd::fpathconfunistd::ttynameunistd::getpeereid(#2137)
-
Changed
openat()andDir::openat(), now take optionaldirfds (#2139) -
The MSRV is now 1.69 (#2144)
-
Changed function
SockaddrIn::ip()to returnnet::Ipv4Addrand refactoredSocketAddrV6::ip()to beconst(#2151) -
The following APIs now take optional
dirfds:readlinkat()fstatat()mknodat()mkdirat()execveat()
(#2157)
-
Epoll::waitnow takesEpollTimeoutreplacingisize. (#2202) -
- Deprecated
errno::errno()function (useErrno::last_raw()) - Deprecated
errno::from_i32()function (useErrno::from_raw()) - Deprecated
errno::Errno::from_i32()function (useErrno::from_raw())
(#2283)
- Deprecated
Fixed
- Fix
SigSetincorrect implementation ofEq,PartialEqandHash(#1946) - Fixed
::sys::socket::sockopt::IpMulticastTtlby fixing the value of optlen passed tolibc::setsockoptand added tests. (#2072) - Fixed the function signature of
recvmmsg, potentially causing UB (#2119) - Fix
SignalFd::set_mask. In 0.27.0 it would actually close the file descriptor. (#2141) - Fixed UnixAddr::new for haiku, it did not record the
sun_lenvalue as needed. Fixedsys::socket::addr::from_raw_partsandsys::socket::Sockaddrlike::lenbuild for solaris. (#2242) - Fixed solaris build globally. (#2248)
- Changed the
dup3wrapper to perform a real call todup3instead of emulating it viadup2andfcntlto get rid of race condition (#2268) - Fixed
::unistd::Group::membersusing read_unaligned to avoid crash on misaligned pointers (#2311)
Removed
- The
FchownatFlagstype has been deprecated, please useAtFlagsinstead. (#2267) - Removed the
dup3wrapper on macOS, which was emulated viadup2andfcntland could cause a race condition. Thedup3system call is not supported on macOS. (#2268) - The
LinkatFlagstype has been deprecated, please useAtFlagsinstead. (#2284)
[0.27.1] - 2023-08-28
Fixed
- Fixed generating the documentation on docs.rs. (#2111)
[0.27.0] - 2023-08-28
Added
- Added
AT_EACCESStoAtFlagson all platforms but android (#1995) - Add
PF_ROUTEtoSockTypeon macOS, iOS, all of the BSDs, Fuchsia, Haiku, Illumos. (#1867) - Added
nix::ucontextmodule onaarch64-unknown-linux-gnu. (#1662) - Added
CanRawtoSockProtocolandCanBcmas a separateSocProtocolconstant. (#1912) - Added
GenericandNFLOGtoSockProtocol. (#2092) - Added
mq_timedreceiveto::nix::mqueue. ([#1966])(https://github.com/nix-rust/nix/pull/1966) - Added
LocalPeerPidtonix::sys::socket::sockoptfor macOS. (#1967) - Added
TFD_TIMER_CANCEL_ON_SETto::nix::sys::time::TimerSetTimeFlagson Linux and Android. (#2040) - Added
SOF_TIMESTAMPING_OPT_IDandSOF_TIMESTAMPING_OPT_TSONLYtonix::sys::socket::TimestampingFlag. (#2048) - Enabled socket timestamping options on Android. (#2077)
- Added vsock support for macOS (#2056)
- Added
SO_SETFIBandSO_USER_COOKIEtonix::sys::socket::sockoptfor FreeBSD. (#2085) - Added
SO_RTABLEfor OpenBSD andSO_ACCEPTFILTERfor FreeBSD/NetBSD tonix::sys::socket::sockopt. (#2085) - Added
MSG_WAITFORONEtoMsgFlagson Android, Fuchsia, Linux, NetBSD, FreeBSD, OpenBSD, and Solaris. (#2014) - Added
SO_TS_CLOCKfor FreeBSD tonix::sys::socket::sockopt. (#2093) - Added support for prctl in Linux. (#1550)
nix::socketandnix::selectare now available on Redox. (#2012)- Implemented AsFd, AsRawFd, FromRawFd, and IntoRawFd for
mqueue::MqdT. (#2097) - Add the ability to set
kevent_flagsonSigEvent. (#1731)
Changed
-
All Cargo features have been removed from the default set. Users will need to specify which features they depend on in their Cargo.toml. (#2091)
-
Implemented I/O safety for many, but not all, of Nix's APIs. Many public functions argument and return types have changed:
Original Type New Type AsRawFd AsFd RawFd BorrowedFd or OwnedFd (#1906)
-
Use I/O safety with
copy_file_range, and expose it on FreeBSD. (#1906) -
The epoll interface now uses a type. (#1882)
-
With I/O-safe type applied in
pty::OpenptyResultandpty::ForkptyResult, users no longer need to manually close the file descriptors in these types. (#1921) -
Refactored
nameparameter ofmq_openandmq_unlinkto be generic overNixPath. (#2102). -
Made
cloneunsafe, likefork. (#1993)
Removed
sys::event::{kevent, kevent_ts}are deprecated in favor ofsys::kevent::Kqueue::kevent, andsys::event::kqueueis deprecated in favor ofsys::kevent::Kqueue::new. (#1943)- Removed deprecated IoVec API. (#1855)
- Removed deprecated net APIs. (#1861)
nix::sys::signalfd::signalfdis deprecated. Usenix::sys::signalfd::SignalFdinstead. (#1938)- Removed
SigEventsupport on Fuchsia, where it was unsound. (#2079) - Removed
flockfrom::nix::fcntlon Solaris. (#2082)
[0.26.3] - 2023-08-27
Fixed
- Fix: send
ETH_P_ALLin htons format (#1925) - Fix:
recvmsgnow sets the length of the receivedsockaddr_unfield correctly on Linux platforms. (#2041) - Fix potentially invalid conversions in
SockaddrIn::from<std::net::SocketAddrV4>,SockaddrIn6::from<std::net::SockaddrV6>,IpMembershipRequest::new, andIpv6MembershipRequest::newwith future Rust versions. (#2061) - Fixed an incorrect lifetime returned from
recvmsg. (#2095)
[0.26.2] - 2023-01-18
Fixed
- Fix
SockaddrIn6bug that was swappingflowinfoandscope_idbyte ordering. (#1964)
[0.26.1] - 2022-11-29
Fixed
- Fix UB with
sys::socket::sockopt::SockTypeusingSOCK_PACKET. (#1821)
[0.26.0] - 2022-11-29
Added
- Added
SockaddrStorage::{as_unix_addr, as_unix_addr_mut}(#1871) - Added
MntFlagsandunmounton all of the BSDs. - Added
any()andall()topoll::PollFd. (#1877) - Add
MntFlagsandunmounton all of the BSDs. (#1849) - Added a
Statfs::flagsmethod. (#1849) - Added
NSFS_MAGICFsType on Linux and Android. (#1829) - Added
sched_getcpuon platforms that support it. (#1825) - Added
sched_getaffinityandsched_setaffinityon FreeBSD. (#1804) - Added
line_disciplinefield toTermioson Linux, Android and Haiku (#1805) - Expose the memfd module on FreeBSD (memfd was added in FreeBSD 13) (#1808)
- Added
domainnamefield ofUtsNameon Android and Linux (#1817) - Re-export
RLIM_INFINITYfromlibc(#1831) - Added
syncfs(2)on Linux (#1833) - Added
faccessat(2)on illumos (#1841) - Added
eaccess()on FreeBSD, DragonFly and Linux (glibc and musl). (#1842) - Added
IP_TOSSO_PRIORITYandIPV6_TCLASSsockopts for Linux (#1853) - Added
new_unnamedandis_unnamedforUnixAddron Linux and Android. (#1857) - Added
SockProtocol::Rawfor raw sockets (#1848) - added
IP_MTU(IpMtu)IPPROTO_IPsockopt on Linux and Android. (#1865)
Changed
- The MSRV is now 1.56.1 (#1792)
- The
addrargument ofsys::mman::mmapis now of typeOption<NonZeroUsize>. (#1870) - The
lengthargument ofsys::mman::mmapis now of typeNonZeroUsize. (#1873)
Fixed
- Fixed using
SockaddrStorageto store a Unix-domain socket address on Linux. (#1871) - Fix microsecond calculation for
TimeSpec. (#1801) - Fix
User::from_nameandGroup::from_namepanicking when given a name containing a nul. (#1815) - Fix
User::from_uidandUser::from_namecrash on Android platform. (#1824) - Workaround XNU bug causing netmasks returned by
getifaddrsto misbehave. (#1788)
Removed
- Removed deprecated error constants and conversions. (#1860)
[0.25.0] - 2022-08-13
Added
- Added
faccessat(#1780) - Added
memfdon Android. (#1773) - Added
ETH_P_ALLtoSockProtocolenum (#1768) - Added four non-standard Linux
SysconfVarvariants (#1761) - Added const constructors for
TimeSpecandTimeVal(#1760) - Added
chflags. (#1758) - Added
aio_writevandaio_readv. (#1713) - impl
From<uid_t>forUidandFrom<gid_t>forGid(#1727) - impl
From<SockaddrIn>forstd::net::SocketAddrV4and implFrom<SockaddrIn6>forstd::net::SocketAddrV6. (#1711) - Added support for the
x86_64-unknown-haikutarget. (#1703) - Added
ptrace::read_userandptrace::write_userfor Linux. (#1697) - Added
getrusageand helper typesUsageWhoandUsage(#1747) - Added the
DontRouteSockOpt (#1752) - Added
signal::SigSet::from_sigset_t_unchecked(). (#1741) - Added the
Ipv4OrigDstAddrsockopt and control message. (#1772) - Added the
Ipv6OrigDstAddrsockopt and control message. (#1772) - Added the
Ipv4SendSrcAddrcontrol message. (#1776)
Changed
-
Reimplemented sendmmsg/recvmmsg to avoid allocations and with better API (#1744)
-
Rewrote the aio module. The new module:
- Does more type checking at compile time rather than runtime.
- Gives the caller control over whether and when to
Boxan aio operation. - Changes the type of the
priorityarguments toi32. - Changes the return type of
aio_returntousize. (#1713)
-
nix::poll::ppoll:sigmaskparameter is now optional. (#1739) -
Changed
gethostnameto return an ownedOsString. (#1745) -
signal:SigSetis now marked asrepr(transparent). (#1741)
Removed
- Removed support for resubmitting partially complete
lio_listiooperations. It was too complicated, and didn't fit Nix's theme of zero-cost abstractions. Instead, it can be reimplemented downstream. (#1713)
[0.24.2] - 2022-07-17
Fixed
- Fixed buffer overflow in
nix::sys::socket::recvfrom. (#1763) - Enabled
SockaddrStorage::{as_link_addr, as_link_addr_mut}for Linux-like operating systems. (#1729) - Fixed
SockaddrLike::from_rawimplementations forVsockAddrandSysControlAddr. (#1736)
[0.24.1] - 2022-04-22
Fixed
- Fixed
UnixAddr::sizeon Linux-based OSes. (#1702)
[0.24.0] - 2022-04-21
Added
- Added fine-grained features flags. Most Nix functionality can now be conditionally enabled. By default, all features are enabled. (#1611)
- Added statfs FS type magic constants for
target_os = "android"and synced constants with libc v0.2.121. (#1690) - Added
fexecveon DragonFly. (#1577) sys::uio::IoVecis nowSendandSync(#1582)- Added
EPOLLEXCLUSIVEon Android. (#1567) - Added
fdatasyncfor FreeBSD, Fuchsia, NetBSD, and OpenBSD. (#1581) - Added
sched_setaffinityandsched_getaffinityon DragonFly. (#1537) - Added
posix_fallocateon DragonFly. (#1621) - Added
SO_TIMESTAMPINGsupport (#1547) - Added getter methods to
MqAttrstruct (#1619) - Added the
TxTimesockopt and control message. (#1564) - Added POSIX per-process timer support (#1622)
- Added
sendfileon DragonFly. (#1615) - Added
UMOUNT_NOFOLLOW,FUSE_SUPER_MAGICon Linux. (#1634) - Added
getresuid,setresuid,getresgid, andsetresgidon DragonFly, FreeBSD, and OpenBSD. (#1628) - Added
MAP_FIXED_NOREPLACEon Linux. (#1636) - Added
fspacectlon FreeBSD (#1640) - Added
accept4on DragonFly, Emscripten, Fuchsia, Illumos, and NetBSD. (#1654) - Added
AsRawFdimplementation onOwningIter. (#1563) - Added
process_vm_readvandprocess_vm_writevon Android. (#1557) - Added
nix::ucontextmodule on s390x. (#1662) - Implemented
Extend,FromIterator, andIntoIteratorforSigSetand addedSigSet::iterandSigSetIter. (#1553) - Added
ENOTRECOVERABLEandEOWNERDEADerror codes on DragonFly. (#1665) - Implemented
ReadandWritefor&PtyMaster(#1664) - Added
MSG_NOSIGNALfor Android, Dragonfly, FreeBSD, Fuchsia, Haiku, Illumos, Linux, NetBSD, OpenBSD and Solaris. (#1670) - Added
waitid. (#1584) - Added
Ipv6DontFragfor android, iOS, linux and macOS. - Added
IpDontFragfor iOS, macOS. (#1692)
Changed
mqueuefunctions now operate on a distinct type,nix::mqueue::MqdT. Accessors take this type by reference, not by value. (#1639)- Removed
SigSet::extendin favor of<SigSet as Extend<Signal>>::extend. Because of this change, you now needuse std::iter::Extendto callextendon aSigSet. (#1553) - Removed the the
PATH_MAXrestriction from APIs accepting paths. Paths will now be allocated on the heap if they are too long. In addition, large instruction count improvements (~30x) were made to path handling. (#1656) - Changed
getrlimitandsetrlimitto userlim_tdirectly instead ofOption<rlim_t>. (#1668) - Deprecated
InetAddrandSockAddrin favor ofSockaddrIn,SockaddrIn6, andSockaddrStorage. (#1684) - Deprecated
IpAddr,Ipv4Addr, andIpv6Addrin favor of their equivalents from the standard library. (#1685) unamenow returns aResult<UtsName>instead of just aUtsNameand ignoring failures from libc. And getters on theUtsNamestruct now return an&OsStrinstead of&str. (#1672)- Replaced
IoVecwithIoSliceandIoSliceMut, and replacedIoVec::from_slicewithIoSlice::new. (#1643)
Fixed
InetAddr::from_stdnow sets thesin_len/sin6_lenfields on the BSDs. (#1642)- Fixed a panic in
LinkAddr::addr. That function now returns anOption. (#1675) (#1677)
Removed
- Removed public access to the inner fields of
NetlinkAddr,AlgAddr,SysControlAddr,LinkAddr, andVsockAddr. (#1614) - Removed
EventFlag::EV_SYSFLAG. (#1635)
[0.23.1] - 2021-12-16
Changed
- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts #1492. From now on, the MSRV is not guaranteed to work with all versions of all dependencies, just with some version of all dependencies. (#1607)
Fixed
- Fixed soundness issues in
FdSet::insert,FdSet::remove, andFdSet::containsinvolving file descriptors outside of the range0..FD_SETSIZE. (#1575)
[0.23.0] - 2021-09-28
Added
- Added the
LocalPeerCredsockopt. (#1482) - Added
TimeSpec::from_durationandTimeSpec::from_timespec(#1465) - Added
IPV6_V6ONLYsockopt. (#1470) - Added
impl From<User> for libc::passwdtrait implementation to convert aUserinto alibc::passwd. Consumes theUserstruct to give ownership over the member pointers. (#1471) - Added
pthread_kill. (#1472) - Added
mknodat. (#1473) - Added
setrlimitandgetrlimit. (#1302) - Added
ptrace::interruptmethod for platforms that supportPTRACE_INTERRUPT(#1422) - Added
IP6T_SO_ORIGINAL_DSTsockopt. (#1490) - Added the
PTRACE_EVENT_STOPvariant to thesys::ptrace::Eventenum (#1335) - Exposed
SockAddr::from_raw_sockaddr(#1447) - Added
TcpRepair(#1503) - Enabled
pwritevandpreadvfor more operating systems. (#1511) - Added support for
TCP_MAXSEGTCP Maximum Segment Size socket options (#1292) - Added
Ipv4RecvErrandIpv6RecvErrsockopts and associated control messages. (#1514) - Added
AsRawFdimplementation onPollFd. (#1516) - Added
Ipv4TtlandIpv6Ttlsockopts. (#1515) - Added
MAP_EXCL,MAP_ALIGNED_SUPER, andMAP_CONCEALmmap flags, and exposedMAP_ANONYMOUSfor all operating systems. (#1522) (#1525) (#1531) (#1534) - Added read/write accessors for 'events' on
PollFd. (#1517)
Changed
FdSet::{contains, highest, fds}no longer require a mutable reference. (#1464)User::gecosand correspondinglibc::passwd::pw_gecosare supported on 64-bit Android, change conditional compilation to include the field in 64-bit Android builds (#1471)eventfds are supported on Android, change conditional compilation to includesys::eventfd::eventfdandsys::eventfd::EfdFlagsfor Android builds. (#1481)- Most enums that come from C, for example
Errno, are now marked as#[non_exhaustive]. (#1474) - Many more functions, mostly contructors, are now
const. (#1476) (#1492) sys::event::KEvent::filternow returns aResultinstead of being infalliable. The only cases where it will now return an error are cases where it previously would've had undefined behavior. (#1484)- Minimum supported Rust version is now 1.46.0. (#1492)
- Rework
UnixAddrto encapsulate internals better in order to fix soundness issues. No longer allows creating aUnixAddrfrom a rawsockaddr_un. (#1496) - Raised bitflags to 1.3.0 and the MSRV to 1.46.0. (#1492)
Fixed
posix_fadvisenow returns errors in the conventional way, rather than as a non-zero value inOk(). (#1538)- Added more errno definitions for better backwards compatibility with Nix 0.21.0. (#1467)
- Fixed potential undefined behavior in
Signal::try_fromon some platforms. (#1484) - Fixed buffer overflow in
unistd::getgrouplist. (#1545)
Removed
- Removed a couple of termios constants on redox that were never actually supported. (#1483)
- Removed
nix::sys::signal::NSIG. It was of dubious utility, and not correct for all platforms. (#1484) - Removed support for 32-bit Apple targets, since they've been dropped by both Rustc and Xcode. (#1492)
- Deprecated
SockAddr/InetAddr::to_strin favor ofToString::to_string(#1495) - Removed
SigevNotifyon OpenBSD and Redox. (#1511)
[0.22.3] - 22 January 2022
Changed
- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts #1492. From now on, the MSRV is not guaranteed to work with all versions of all dependencies, just with some version of all dependencies. (#1607)
[0.22.2] - 28 September 2021
Fixed
- Fixed buffer overflow in
unistd::getgrouplist. (#1545) - Added more errno definitions for better backwards compatibility with Nix 0.21.0. (#1467)
[0.22.1] - 13 August 2021
Fixed
- Locked bitflags to < 1.3.0 to fix the build with rust < 1.46.0.
Removed
- Removed a couple of termios constants on redox that were never actually supported. (#1483)
[0.22.0] - 9 July 2021
Added
- Added
if_nameindex(#1445) - Added
nmountfor FreeBSD. (#1453) - Added
IpFreebindsocket option (sockopt) on Linux, Fuchsia and Android. (#1456) - Added
TcpUserTimeoutsocket option (sockopt) on Linux and Fuchsia. (#1457) - Added
renameat2for Linux (#1458) - Added
RxqOvflsupport on Linux, Fuchsia and Android. (#1455)
Changed
ptsname_rnow returns a lossily-converted string in the event of bad UTF, just likeptsname. (#1446)- Nix's error type is now a simple wrapper around the platform's Errno. This
means it is now
Into<std::io::Error>. It's alsoClone,Copy,Eq, and has a small fixed size. It also requires less typing. For example, the old enum variantnix::Error::Sys(nix::errno::Errno::EINVAL)is now simplynix::Error::EINVAL. (#1446)
[0.21.2] - 29 September 2021
Fixed
- Fixed buffer overflow in
unistd::getgrouplist. (#1545)
[0.21.1] - 13 August 2021
Fixed
- Locked bitflags to < 1.3.0 to fix the build with rust < 1.46.0.
Removed
- Removed a couple of termios constants on redox that were never actually supported. (#1483)
[0.21.0] - 31 May 2021
Added
- Added
getresuidandgetresgid(#1430) - Added TIMESTAMPNS support for linux (#1402)
- Added
sendfile64(#1439) - Added
MS_LAZYTIMEtoMsFlags(#1437)
Changed
- Made
forkptyunsafe, likefork(#1390) - Made
Uid,GidandPidmethodsfrom_rawandas_rawaconst fn(#1429) - Made
Uid::is_rootaconst fn(#1429) AioCbis now always pinned. Once alibc::aiocbgets sent to the kernel, its address in memory must not change. Nix now enforces that by usingstd::pin. Most users won't need to change anything, except when usingaio_suspend. See that method's documentation for the new usage. (#1440)LioCbis now constructed using a distinctLioCbBuilderstruct. This avoids a soundness issue with the oldLioCb. Usage is similar but construction now uses the builder pattern. See the documentation for details. (#1440)- Minimum supported Rust version is now 1.41.0. (#1440)
- Errno aliases are now associated consts on
Errno, instead of consts in theerrnomodule. (#1452)
Fixed
- Allow
sockaddr_llsize, as reported by the Linux kernel, to be smaller then it's definition (#1395) - Fix spurious errors using
sendmmsgwith multiple cmsgs (#1414) - Added
Errno::EOPNOTSUPPto FreeBSD, where it was missing. (#1452)
Removed
- Removed
sys::socket::accept4from Android arm because libc removed it in version 0.2.87. (#1399) AioCb::from_boxed_sliceandAioCb::from_boxed_mut_slicehave been removed. They were useful with earlier versions of Rust, but should no longer be needed now that async/await are available.AioCbs now work exclusively with borrowed buffers, not owned ones. (#1440)- Removed some Errno values from platforms where they aren't actually defined. (#1452)
[0.20.2] - 28 September 2021
Fixed
- Fixed buffer overflow in
unistd::getgrouplist. (#1545)
[0.20.1] - 13 August 2021
Fixed
- Locked bitflags to < 1.3.0 to fix the build with rust < 1.46.0.
Removed
- Removed a couple of termios constants on redox that were never actually supported. (#1483)
[0.20.0] - 20 February 2021
Added
- Added a
passwdfield toGroup(#1338) - Added
mremap(#1306) - Added
personality(#1331) - Added limited Fuchsia support (#1285)
- Added
getpeereid(#1342) - Implemented
IntoIteratorforDir(#1333).
Changed
- Minimum supported Rust version is now 1.40.0. (#1356)
- i686-apple-darwin has been demoted to Tier 2 support, because it's deprecated by Xcode. (#1350)
- Fixed calling
recvfromon anAddrFamily::Packetsocket (#1344)
Fixed
TimerFdnow closes the underlying fd on drop. (#1381)- Define
*_MAGICfilesystem constants on Linux s390x (#1372) - mqueue, sysinfo, timespec, statfs, test_ptrace_syscall() on x32 (#1366)
Removed
Dir,SignalFd, andPtyMasterare no longerClone. (#1382)- Removed
SockLevel, which hasn't been used for a few years (#1362) - Removed both
CopyandClonefromTimerFd. (#1381)
[0.19.1] - 28 November 2020
Fixed
- Fixed bugs in
recvmmsg. (#1341)
[0.19.0] - 6 October 2020
Added
- Added Netlink protocol families to the
SockProtocolenum (#1289) - Added
clock_gettime,clock_settime,clock_getres,clock_getcpuclockidfunctions andClockIdstruct. (#1281) - Added wrapper functions for
PTRACE_SYSEMUandPTRACE_SYSEMU_SINGLESTEP. (#1300) - Add support for Vsock on Android rather than just Linux. (#1301)
- Added
TCP_KEEPCNTandTCP_KEEPINTVLTCP keepalive options. (#1283)
Changed
- Expose
SeekDataandSeekHoleon all Linux targets (#1284) - Changed unistd::{execv,execve,execvp,execvpe,fexecve,execveat} to take both
&[&CStr]and&[CString]as its list argument(s). (#1278) - Made
unistd::forkan unsafe funtion, bringing it in line with libstd's decision. (#1293)
[0.18.0] - 26 July 2020
Added
- Added
fchown(2)wrapper. (#1257) - Added support on linux systems for
MAP_HUGE_SIZEfamily of flags. (#1211) - Added support for
F_OFD_*fcntlcommands on Linux and Android. (#1195) - Added
env::clearenv(): callslibc::clearenvon platforms where it's available, and clears the environment of all variables viastd::env::varsandstd::env::remove_varon others. (#1185) FsTypeinner value made public. (#1187)- Added
unistd::setfsuidandunistd::setfsgidto set the user or group identity for filesystem checks per-thread. (#1163) - Derived
Ord,PartialOrdforunistd::Pid(#1189) - Added
select::FdSet::fdsmethod 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
sendmmsgandrecvmmsgcalls (#1208) - Added support for
SCM_CREDSmessages (UnixCredentials) on FreeBSD/DragonFly (#1216) - Added
BindToDevicesocket option (sockopt) on Linux (#1233) - Added
EventFilterbitflags forEV_DISPATCHandEV_RECEIPTon OpenBSD. (#1252) - Added support for
Ipv4PacketInfoandIpv6PacketInfotoControlMessage. (#1222) CpuSetandUnixCredentialsnow implementDefault. (#1244)- Added
unistd::ttyname(#1259) - Added support for
Ipv4PacketInfoandIpv6PacketInfotoControlMessagefor iOS and Android. (#1265) - Added support for
TimerFd. (#1261)
Changed
- Changed
fallocatereturn type fromc_intto()(#1201) - Enabled
sys::ptrace::setregsandsys::ptrace::getregson x86_64-unknown-linux-musl target (#1198) - On Linux,
ptrace::writeis now anunsafefunction. Caveat programmer. (#1245) execv,execve,execvpandexecveatin::nix::unistdandrebootin::nix::sys::rebootnow returnResult<Infallible>instead ofResult<Void>(#1239)sys::socket::sockaddr_storage_to_addris no longerunsafe. So isoffset_of!.sys::socket::sockaddr_storage_to_addr,offset_of!, andErrno::clearare no longerunsafe.SockAddr::as_ffi_pair,sys::socket::sockaddr_storage_to_addr,offset_of!, andErrno::clearare no longerunsafe. (#1244)- Several
Inotifymethods now takeselfby value instead of by reference (#1244) nix::poll::ppoll:timeoutparameter 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_datatoaf_alg_iv(#1206) -
Fixed
readlink/readlinkatwhen reading symlinks longer thanPATH_MAX(#1231) -
PollFd,EpollEvent,IpMembershipRequest,Ipv6MembershipRequest,TimeVal, andIoVecare nowrepr(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_sockaddrfrom the public API. (#1215) -
Removed
sys::termios::{get_libc_termios, get_libc_termios_mut, update_wrapperfrom the public API. These were previously hidden in the docs but still usable by downstream. (#1235) -
Nix no longer implements
NixPathforOption<P> where P: NixPath. Most Nix functions that acceptNixPatharguments can't do anything useful withNone. The exceptions (mountandquotactl_sync) already take explicitly optional arguments. (#1242) -
Removed
unistd::daemonandunistd::pipe2on OSX and ios (#1255) -
Removed
sys::event::FilterFlag::NOTE_EXIT_REPARENTEDandsys::event::FilterFlag::NOTE_REAPon OSX and ios. (#1255) -
Removed
sys::ptrace::ptraceon Android and Linux. (#1255) -
Dropped support for powerpc64-unknown-linux-gnu (#1266)
[0.17.0] - 3 February 2020
Added
- Add
CLK_TCKtoSysconfVar(#1177)
Removed
- Removed deprecated Error::description from error types (#1175)
[0.16.1] - 23 December 2019
Fixed
- Fixed the build for OpenBSD (#1168)
[0.16.0] - 1 December 2019
Added
-
Added
ptrace::seize(): similar toattach()on Linux but with better-defined semantics. (#1154) -
Added
Signal::as_str(): returns signal name as&'static str(#1138) -
Added
posix_fallocate. (#1105) -
Implemented
DefaultforFdSet(#1107) -
Added
NixPath::is_empty. (#1107) -
Added
mkfifoat([#1133](https://github.com/nix
- Add socket option
-
0.29.024 May 2024 -
0.28.024 Feb 2024 -
0.27.128 Aug 2023 -
0.27.028 Aug 2023 -
0.26.428 Aug 2023Nothing published for this version
-
0.26.327 Aug 2023 withdrawnNothing published for this version
-
0.26.218 Jan 2023Nothing published for this version
-
0.26.129 Nov 2022Nothing published for this version
-
0.26.029 Nov 2022Nothing published for this version
-
0.25.102 Dec 2022Nothing published for this version
-
0.25.013 Aug 2022Nothing published for this version
-
0.24.302 Dec 2022Nothing published for this version
-
0.24.217 Jul 2022Nothing published for this version
-
0.24.122 Apr 2022Nothing published for this version
-
0.24.021 Apr 2022Nothing published for this version
-
0.23.203 Dec 2022Nothing published for this version
-
0.23.117 Dec 2021Nothing published for this version
-
0.23.029 Sep 2021Nothing published for this version
-
0.22.323 Jan 2022Nothing published for this version
-
0.22.229 Sep 2021Nothing published for this version
-
0.22.114 Aug 2021Nothing published for this version
-
0.22.009 Jul 2021Nothing published for this version
-
0.21.229 Sep 2021Nothing published for this version
-
0.21.114 Aug 2021Nothing published for this version
-
0.21.031 May 2021Nothing published for this version
-
0.20.229 Sep 2021Nothing published for this version
-
0.20.114 Aug 2021Nothing published for this version
-
0.20.020 Feb 2021Nothing published for this version
-
0.19.129 Nov 2020Nothing published for this version
-
0.19.013 Oct 2020Nothing published for this version
-
0.18.027 Jul 2020Nothing published for this version
-
0.17.004 Feb 2020Nothing published for this version
-
0.16.124 Dec 2019Nothing published for this version
-
0.16.002 Dec 2019Nothing published for this version
-
0.15.010 Aug 2019Nothing published for this version
-
0.14.107 Jun 2019Nothing published for this version
-
0.14.022 May 2019Nothing published for this version
-
0.13.111 Jun 2019Nothing published for this version
-
0.13.015 Jan 2019Nothing published for this version
-
0.12.108 Jun 2019Nothing published for this version
-
0.12.028 Nov 2018Nothing published for this version
-
0.11.107 Jun 2019Nothing published for this version
-
0.11.002 Jun 2018Nothing published for this version
-
0.10.026 Jan 2018Nothing published for this version
-
0.9.024 Jul 2017Nothing published for this version
-
0.8.117 Apr 2017Nothing published for this version
-
0.8.002 Mar 2017Nothing published for this version
-
0.7.009 Sep 2016Nothing published for this version
-
0.6.010 Jun 2016Nothing published for this version
-
0.5.111 Jun 2016Nothing published for this version
-
0.5.1-pre10 Jun 2016 pre-release withdrawnNothing published for this version
-
0.5.002 Mar 2016Nothing published for this version
-
0.4.312 Jun 2016Nothing published for this version
-
0.4.204 Dec 2015Nothing published for this version