summaryrefslogtreecommitdiff
path: root/src/unistd.rs
AgeCommit message (Collapse)Author
2016-10-02Auto merge of #428 - philippkeller:mkstemp, r=fiveopHomu
Add Mkstemp (fixed for rust 1.2) I fixed @antifuchs addition of `mkstmp` in https://github.com/nix-rust/nix/pull/365 by making it compile in Rust 1.2 and adding documentation. A few remarks: - made it working with Rust 1.2 which needed `to_bytes_with_nul()`. I think the implementation is memory safe but would like to have a pair of eyes checking that - replaced Path by PathBuf so it's more in line with getcwd - I didn't move it into another module. If this still the consensus then I would like to do that but in a separate PR (probably moving all stdio methods out) - it's true that unistd doesn't need mkstmp since there is the crate tempdir and tempfile, but I'd love to see this here for completeness
2016-09-28Add debug_assert ensuring popped byte is nulPhilipp Keller
2016-09-27Remove double copy of array (to_owned() and PathBuf::from), use ↵Philipp Keller
OsString::from_vec on existing path var rather than construct string from pointer
2016-09-27move path outside closure to avoid use after free, restructed for easier ↵Philipp Keller
readability
2016-09-16fixing build for aarch64-unknown-linux-gnu (which expects the pointer to be ↵Philipp Keller
*mut u8 whereas x86_64 and i686 expect it to be *mut i8)
2016-09-16made it running with rust 1.2, added documentation to mkstempPhilipp Keller
2016-09-15make unsafe code more fine-grained in pipe2Jack O'Connor
2016-09-14call pipe2 directly on LinuxJack O'Connor
2016-09-07resolving all remarks by @posborne, fixed max line length=99, fixed rust ↵Philipp Keller
1.2.0 error in doc-test
2016-09-06rust 1.2.0 doesn't support expect, switched to proper match blockPhilipp Keller
2016-09-06added documentation for getcwd and mkdir, changed test so that it compares ↵Philipp Keller
against std::env::current_dir
2016-09-06fixed the trailing whitespacesPhilipp Keller
2016-09-06made it running with rust 1.2.0: the code for getcwd is now an exact copy of ↵Philipp Keller
the implementation in std
2016-09-05implemented mkdir, extended getcwd test to include long path namesPhilipp Keller
2016-09-02implemented getcwd (returning Result<PathBuf>, reconciling all calls to ↵Philipp Keller
expect into proper try handling), needs testing still
2016-08-10Fix the sethostname binding on FreeBSD and DragonflyBSDAlan Somers
2016-06-13Added lseek to unistdAndrei Oprisan
llseek and lseek64 impl Whence fixed formatting awful typo when refactoring no llseek wrong test name using off64_t got rid of offset Added SeekHole/Data; formatted test; SeekCur/Set/End use libc constants
2016-05-06Use Wrapping for intended underflow of unsigned integer value.Philipp Matthias Schaefer
2016-05-01Return both the fd and the created pathAndreas Fuchs
2016-05-01Add mkstemp(3)Andreas Fuchs
2016-04-18Use Void in exec return typearcnmx
2016-04-14Auto merge of #350 - llogiq:clippy, r=posborneHomu
fixed a few clippy warnings Just a few style nits. Hope it'll be useful anyway :smile:
2016-04-13unistd: Add sleep(3)Kamal Marhubi
2016-04-14fixed a few clippy warningsAndre Bogus
2016-03-30unistd: Mark fork() and related methods as #[inline]Kamal Marhubi
2016-03-30unistd: Redesign the enum returned by fork()Kamal Marhubi
This commit changes the name of the enum returned by `fork()` to `ForkResult`, and changes the `Parent` variant to be struct-like. The result can be matched like use nix::unistd::ForkResult::*; match fork().unwrap() { Parent { child } => { ... } Child => { ... } } using the shorthand matching syntax for struct-like enum variants. This is a breaking change.
2016-03-30unistd: Add pause(2)Kamal Marhubi
2016-03-07Add gettidDave Hylands
2016-03-06unistd: Use bindings from libc instead of our ownKamal Marhubi
Refs https://github.com/nix-rust/nix/issues/264
2016-02-20unistd: add chown syscallNikolay Amiantov
2016-02-19unistd: add setuid, setgid syscallsNikolay Amiantov
2016-01-28Move errno::Result back to crate rootarcnmx
2016-01-28Errno::result()arcnmx
2016-01-18allow improper_ctypes for size_tMattis Marjak
2016-01-18update libc to 0.2.2Mattis Marjak
2016-01-13Add safe wrappers for getuid, geteuid, getgid, getegidKamal Marhubi
Fixes #213
2015-12-22Fix broken tests on nightlyCarl Lerche
2015-12-03add an implementation of setpgidDavid Roundy
2015-10-27Add support for fsync, fdatasyncJeremy Fitzhardinge
2015-10-27Fix some commentsJeremy Fitzhardinge
2015-10-16Fix memory issue with exec family of fnsCarl Lerche
2015-08-10Add missing exec functionsNik Klassen
2015-07-07remove unneeded mut.Felix Kronlage
nightly will comment this with: --- src/unistd.rs:241:13: 241:20 error: variable does not need to be mutable, #[deny(unused_mut)] on by default src/unistd.rs:241 let mut res; ---
2015-07-06Add feature flag around execvpeTilde Engineering
2015-06-24Implement more fcntl operationsAndy Grover
Derive some more traits on flock to make life easier Change fcntl to return Result<c_int> so we can get results of F_GET* ops. Change pipe2_setflags to match.
2015-05-28Remove std::os::unix::io::RawFd re-exportCarl 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-19added getpid and getppidMarkus Jais
2015-05-05feat: add execvpeQingping Hou
2015-04-28feat: add chroot syscallQingping Hou