summaryrefslogtreecommitdiff
path: root/src/lib.rs
AgeCommit message (Collapse)Author
2017-02-19Fix the style for bitflags!Mathias Svensson
Prefer libc_bitflags! over bitflags!. Prefer libc::CONSTANTS over writing the constant manually.
2016-10-27error: add documentation for nix::ErrorPaul Osborne
Signed-off-by: Paul Osborne <paul.osborne@smartthings.com>
2016-08-31Replace ffi module by libc functions in mqueue.rsPhilipp Matthias Schaefer
2016-06-06Only deny warnings in testKamal Marhubi
This prevents us breaking builds under newer Rust versions with additional warnings.
2016-04-18Use Void in exec return typearcnmx
2016-03-17Auto merge of #311 - fiveop:context, r=@kamalmarhubiHomu
Add context module. The module wraps context handling related functions and structs.
2016-03-16Add libc_bitflags convenience macroKamal Marhubi
We define many bitflags types with values from the libc crate. Currently these look like this: bitflags!{ flags ProtFlags: libc::c_int { const PROT_NONE = libc::PROT_NONE, const PROT_READ = libc::PROT_READ, const PROT_WRITE = libc::PROT_WRITE, const PROT_EXEC = libc::PROT_EXEC, #[cfg(any(target_os = "linux", target_os = "android"))] const PROT_GROWSDOWN = libc::PROT_GROWSDOWN, #[cfg(any(target_os = "linux", target_os = "android"))] const PROT_GROWSUP = libc::PROT_GROWSUP, } } There's some repetition which is tedious. With the new macro, the above can instead be written libc_bitflags!{ flags ProtFlags: libc::c_int { PROT_NONE, PROT_READ, PROT_WRITE, PROT_EXEC, #[cfg(any(target_os = "linux", target_os = "android"))] PROT_GROWSDOWN, #[cfg(any(target_os = "linux", target_os = "android"))] PROT_GROWSUP, } } Thanks to Daniel Keep for the Little Book of Rust Macros, and for helping with this macro. Refs https://github.com/nix-rust/nix/issues/264
2016-03-14Add context module.Philipp Matthias Schaefer
The module wraps context handling related functions and structs.
2016-03-11libc: re-export libc properlyPaul Osborne
With rust 1.7, the following warning was being emitted by the compiler: warning: `pub extern crate` does not work as expected and should not be used. Likely to become an error. Prefer `extern crate` and `pub use`. Based on https://github.com/rust-lang/rust/issues/26775 it appears that the warning in 1.7 which was to be escalated to an error is going away but in older versions of rust it is still the case that `pub extern crate` will not work as expected. Instead, we use a somewhat creative hack to export the libc root as a module in nix. Down the line, it may make sense to either eliminate the need to export libc (by chaning the ioctl macros) or to move toward deprecated older versions of rustc. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-03-06unistd: Use bindings from libc instead of our ownKamal Marhubi
Refs https://github.com/nix-rust/nix/issues/264
2016-02-28Make crate libc import public.Philipp Matthias Schaefer
2016-01-28Move errno::Result back to crate rootarcnmx
2016-01-28Errno::result()arcnmx
2016-01-27Avoid stack allocation in with_nix_path for Option::NoneKamal Marhubi
2016-01-27Implement NixPath for Option<&T> where T: NixPathKamal Marhubi
2016-01-27Implement NixPath for str and OsStrKamal Marhubi
This is a stop gap improvement until the NixPath reform is figured out. refs #221
2016-01-27Use the net module unconditionallyKamal Marhubi
The functions defined are POSIX and should exist on all platforms nix supports.
2016-01-27Added if_nametoindex (and necessary module based on Cs net/if.h)Marc Brinkmann
2016-01-25Implement NixPath for CStrKamal Marhubi
This makes NixPath more versatile while waiting to see if there will be a NixPath overhaul. Refs https://github.com/carllerche/nix-rust/issues/221
2016-01-25Add everything from poll.h.Utkarsh Kukreti
2016-01-18Update to libc 0.2.4User Vagrant
2016-01-18update libc to 0.2.2Mattis Marjak
2015-11-03Use `libc::PATH_MAX` in `NixPath::with_nix_path`.Utkarsh Kukreti
2015-10-27Improve Error interoperability with stdJeremy Fitzhardinge
- Add From implementaion for io::Error, so nix::Error can be turned into a std::io::Error. - Add From from Errno - a little more idiomatic than from_errno these days - Implement std::error::Error for nix::Error
2015-08-12Update some stuff for upstream bitflags changesCorey Richardson
2015-05-28Remove std::os::unix::io::RawFd re-exportCarl Lerche
2015-05-28Move nix::mq -> nix::mqueue to mirror headerCarl Lerche
2015-05-21Fix NixPath yield with CStr instead of OsStrCarl Lerche
As described in #117, the `AsExtStr` trait is defined to return a raw `*const libc::c_char`. Its impl for `OsStr` simply borrowed the byte slice from its `OsStr` argument and cast it to a `*const libc::c_char`, which does not construct a proper null-terminated C string. Given this, the `AsExtStr` is not necessary and is removed. `NixPath` is updated to yield `CStr`. Fixes #117, #120 Thanks to @dead10ck
2015-05-07Scope to unix platformsCarl Lerche
2015-04-27Basic Posix MQ supportMarkus Jais
2015-04-07Error on warningsCarl Lerche
2015-04-07Add Error::from_errnoCarl Lerche
2015-04-06Get compiling on Rust 1.0 betaCarl Lerche
Initially support this by assuming the lowest common denominator. The long term solution is to improve the build system to allow pulling in more specific features that are available on the target system.
2015-04-03Fd ist now RawFdFlorian Hartwig
2015-04-01Fix argument order for copy* functionsFlorian Hartwig
2015-03-25Use libc from crates.ioCarl Lerche
2015-03-25Track Rust masterCarl Lerche
2015-03-24NixResult -> nix::Result; NixError -> nix::ErrorCarl Lerche
2015-03-19Track Rust nightliesCarl Lerche
2015-03-16Fix deprecation warningsCarl Lerche
2015-03-13Amend some files to make it compile on arm-linux-androideabi.kennytm
2015-02-27Further SockAddr & NixPath cleanupCarl Lerche
2015-02-25Large cleanup, mostly of socket functionsCarl Lerche
2015-02-21Fix uio and add SockAddr conversionsCarl Lerche
2015-02-20Remove hash feature declarationSebastian Lauwers
2015-02-19Test errno definesCarl Lerche
2015-02-14Fix warningsCarl Lerche
2015-02-10Add `NixPath`, `NixError`, and `NixResult`.Utkarsh Kukreti
2015-02-10Fix warningsCarl Lerche
2015-01-16Fix for `bitflags!`, refs https://github.com/rust-lang/rust/pull/21254Fantix King