Skip to content

Commit

Permalink
fcntl: Expose FcntlArg variants at the module level
Browse files Browse the repository at this point in the history
This allows importing them directly from `nix::fcntl` which is more
ergonomic than needing to use them via `FcntlArg`.
  • Loading branch information
kamalmarhubi committed Feb 28, 2017
1 parent 06d9b04 commit 223ce2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,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.
([#TODO](https://github.com/nix-rust/nix/pull/TODO))

### Fixed
- Fixed multiple issues with Unix domain sockets on non-Linux OSes
Expand Down
3 changes: 1 addition & 2 deletions src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,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<c_int> {
use self::FcntlArg::*;

let res = unsafe {
match arg {
F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd),
Expand Down

0 comments on commit 223ce2a

Please sign in to comment.