Skip to content

Commit 70a1bd4

Browse files
committed
Auto merge of #541 - kamalmarhubi:export-fcntl-args, r=fiveop
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`.
2 parents c47f664 + 33f8f3c commit 70a1bd4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

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

9699
### Fixed
97100
- Fixed multiple issues with Unix domain sockets on non-Linux OSes

src/fcntl.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ pub enum FcntlArg<'a> {
5555

5656
// TODO: Rest of flags
5757
}
58+
pub use self::FcntlArg::*;
5859

5960
// TODO: Figure out how to handle value fcntl returns
6061
pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result<c_int> {
61-
use self::FcntlArg::*;
62-
6362
let res = unsafe {
6463
match arg {
6564
F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd),

0 commit comments

Comments
 (0)