Commit ffbc040e authored by SamwiseFilmore's avatar SamwiseFilmore

Update README; Fix Conditional Compile

parent 3e2558ba
# redox_users
# redox_users <img src="https://img.shields.io/crates/v/redox_users.svg">
Redox OS APIs for accessing users and groups information.
Redox OS APIs for accessing users and groups information. [Documentation](https://docs.rs/redox_users/0.1.0/redox_users/)
High level APIs for:
......@@ -14,24 +14,7 @@ We recommend to use these APIs instead of directly manipulating the
`/etc/group` and `/etc/passwd` as this is an implementation detail and
might change in the future.
## Using redox_users
Make sure you have Rust nightly.
Add `redox_users` to `Cargo.toml`:
```toml
[dependencies.redox_users]
git = "https://github.com/redox-os/users.git"
```
then import it in your main file:
```rust
extern crate redox_users;
```
And `redox_users` is now ready to roll!
Note that redox_users is an API designed only for use on Redox. It compiles on other platforms (for testing), but it will not work and might produce unexpected behavior.
## Hashing
redox_users uses the Argon2 hashing algorithm. The default hashing parameters are as follows:
......
......@@ -78,7 +78,7 @@ fn read_locked_file(file: &str) -> Result<String> {
.read(true)
.custom_flags(O_SHLOCK as i32)
.open(file)?;
#[cfg(target_os="linux")]
#[cfg(not(target_os="redox"))]
let mut file = OpenOptions::new()
.read(true)
.open(file)?;
......@@ -99,7 +99,7 @@ fn write_locked_file(file: &str, data: String) -> Result<()> {
.truncate(true)
.custom_flags(O_EXLOCK as i32)
.open(file)?;
#[cfg(target_os="linux")]
#[cfg(not(target_os="redox"))]
let mut file = OpenOptions::new()
.write(true)
.truncate(true)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment