From 8049e82799c19ef31280428677cd0a208656d703 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Thu, 8 Nov 2018 17:23:43 -0500 Subject: [PATCH] Add ENOTSUP to Linux and Android While ENOTSUP is defined as equal to EOPNOTSUPP on these platforms, exposing the ENOTSUP symbol (as libc does) allows for writing portable code that may want to reference this error code. --- CHANGELOG.md | 3 ++- src/errno.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f94c24f6..995cbe32d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Add IP_RECVIF & IP_RECVDSTADDR. Enable IP_PKTINFO and IP6_PKTINFO on netbsd/openbsd. ([#1002](https://github.com/nix-rust/nix/pull/1002)) - - Added `inotify_init1`, `inotify_add_watch` and `inotify_rm_watch` wrappers for Android and Linux. ([#1016](https://github.com/nix-rust/nix/pull/1016)) +- Added ENOTSUP errno support for Linux and Android. + ([#969](https://github.com/nix-rust/nix/pull/969)) ### Changed - `PollFd` event flags renamed to `PollFlags` ([#1024](https://github.com/nix-rust/nix/pull/1024/)) diff --git a/src/errno.rs b/src/errno.rs index 977ea0b64d..81a91c8c53 100644 --- a/src/errno.rs +++ b/src/errno.rs @@ -675,6 +675,7 @@ mod consts { pub const EWOULDBLOCK: Errno = Errno::EAGAIN; pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; pub fn from_i32(e: i32) -> Errno { use self::Errno::*;