Proxmox-rs nix backport for loongarch64
Go to file
Homu 3612b35753 Auto merge of #416 - philippkeller:master, r=posborne
add unistd::getcwd and unistd::mkdir

As a (late) followup of [this withdrawn PR](https://github.com/rust-lang/libc/pull/326) I have added getcwd (wrapper around `libc::getcwd`) and mkdir (wrapper around `libc::mkdir`) and added testing.

A few notes:

 - I'm new to rust so I would appreciate some pair of eyes testing the code, plus I'm open for revision of code or general remarks about my coding style
 - I have run the tests both on OSX as on Linux (Ubuntu)
 - I've run `clippy` to see if my code is well formatted, however clippy issues many warnings about the project. I think I didn't add any more warnings
 - the methods in unistd are not documented so I also left out the documentation of `getcwd` and `mkdir`, although I think it'd probably be good to add some documentation, especially some example code how to use the methods
 - the base idea of `getcwd` is [taken from std](https://github.com/rust-lang/rust/blob/1.9.0/src/libstd/sys/unix/os.rs#L95-L119), should I mention that somewhere?
2016-09-08 01:26:43 +09:00
ci ci: fix docker container check 2016-08-10 19:30:12 -05:00
nix-test test: clean up the test build script 2016-03-05 18:01:09 -06:00
src Auto merge of #416 - philippkeller:master, r=posborne 2016-09-08 01:26:43 +09:00
test Auto merge of #416 - philippkeller:master, r=posborne 2016-09-08 01:26:43 +09:00
.gitignore Test errno defines 2015-02-19 19:30:19 -08:00
.travis.yml No longer support Rust 1.1 2016-08-05 21:19:09 +02:00
build.rs Fix raw_pointer_derive warning 2016-04-02 10:20:19 -04:00
Cargo.toml Use git master as libc version 2016-07-13 00:58:30 +03:00
CHANGELOG.md Auto merge of #392 - fiveop:less_ffi, r=@fiveop 2016-09-01 17:54:33 +09:00
CONTRIBUTING.md Introduce CHANGELOG.md 2016-07-22 23:42:34 +02:00
CONVENTIONS.md Introduce CHANGELOG.md 2016-07-22 23:42:34 +02:00
deploy.sh Automatically deploy docs 2015-02-20 16:27:29 -08:00
LICENSE Add a license file 2015-02-02 10:51:34 -08:00
README.md docs: update readme to be a bit more useful 2016-07-12 13:04:17 -07:00
RELEASE_PROCEDURE.md Introduce CHANGELOG.md 2016-07-22 23:42:34 +02:00

Rust bindings to *nix APIs

Build Status crates.io

Documentation

Nix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin, ...). The goal is to not provide a 100% unified interface, but to unify what can be while still providing platform specific APIs.

For many system APIs, Nix provides a safe alternative to the unsafe APIs exposed by the libc crate. This is done by wrapping the libc functionality with types/abstractions that enforce legal/safe usage.

As an example of what Nix provides, examine the differences between what is exposed by libc and nix for the gethostname system call:

// libc api (unsafe, requires handling return code/errno)
pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int;

// nix api (returns a nix::Result)
pub fn gethostname(name: &mut [u8]) -> Result<()>;

Usage

To use nix, first add this to your Cargo.toml:

[dependencies]
nix = "0.6.0"

Then, add this to your crate root:

extern crate nix;

Contributing

Contributions are very welcome. Please See CONTRIBUTING for additional details.

License

Nix is licensed under the MIT license. See LICENSE for more details.