Skip to content

Commit 1e0393a

Browse files
committed
fcntl: Expose FcntlArg variants at the module level
This allows importing them directly from `nix::fcntl` which is more ergonomic than needing to use them via `FcntlArg`.
1 parent 06d9b04 commit 1e0393a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
9090
return a `&CStr` within the provided buffer that is always properly
9191
NUL-terminated (this is not guaranteed by the call with all platforms/libc
9292
implementations).
93+
- Exposed all fcntl(2) operations at the module level, so they can be
94+
imported direclty instead of via `FcntlArg` enum.
95+
([#541](https://github.com/nix-rust/nix/pull/541))
9396

9497
### Fixed
9598
- Fixed multiple issues with Unix domain sockets on non-Linux OSes

src/fcntl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ pub enum FcntlArg<'a> {
5151

5252
// TODO: Rest of flags
5353
}
54+
pub use self::FcntlArg::*;
5455

5556
// TODO: Figure out how to handle value fcntl returns
5657
pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
57-
use self::FcntlArg::*;
58-
5958
let res = unsafe {
6059
match arg {
6160
F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd),

0 commit comments

Comments
 (0)