diff --git a/CHANGELOG.md b/CHANGELOG.md index c46e94f5aa..aa12f127c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). return a `&CStr` within the provided buffer that is always properly NUL-terminated (this is not guaranteed by the call with all platforms/libc implementations). +- Exposed all fcntl(2) operations at the module level, so they can be + imported direclty instead of via `FcntlArg` enum. + ([#541](https://github.com/nix-rust/nix/pull/541)) ### Fixed - Fixed multiple issues with Unix domain sockets on non-Linux OSes diff --git a/src/fcntl.rs b/src/fcntl.rs index 64e9fb60a4..e224d3b107 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -55,11 +55,10 @@ pub enum FcntlArg<'a> { // TODO: Rest of flags } +pub use self::FcntlArg::*; // TODO: Figure out how to handle value fcntl returns pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result { - use self::FcntlArg::*; - let res = unsafe { match arg { F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd),