summaryrefslogtreecommitdiff
path: root/src/unistd.rs
AgeCommit message (Collapse)Author
2017-07-02Newtypes for uid_t, gid_t and pid_t.Martin Habovštiak
2017-04-21remove test warningsking6cong
2017-01-19unistd: add fchdir(2)Luca Bruno
This introduces a wrapper for fchdir(2), allowing a process to change directory based on an open file descriptor. The underlying function is available in libc crate since 0.2.20.
2017-01-15sethostname: convert to taking OsStr refPaul Osborne
Baed on discussions on the related PR, sethostname now takes an `S: AsRef<OsStr>` in order to allow for a greater range of inputs that allow for a more fluid interface. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2017-01-15unistd: document and change implementation of gethostnamePaul Osborne
Previously gethostname just mutated a buffer. We now provide a slightly more usable (but still allocation free) API that ensures that the returned buffer is NUL-terminated. We give back a `&CStr` instead of requiring that the user do all of the conversions from `&[u8]` when we know we are dealing with a `&CStr`. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2017-01-15unistd: add docs for gethostname and tweak APIPaul Osborne
Although the underlying C API does take a pointer to a set of characters, it is a requirement of almost every operating system that these bytes not contain a premature NUL character or other special characters. In other words, you want a `&str`. Changing this to make the API make a bit more sense. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-12-12Added getpgrpzethra
2016-11-23Fixed typo in tcsetpgrpzethra
2016-11-13Avoid TempDir::into_path(), because it doesn't cleanup on DropAlan Somers
2016-11-08Added .map(drop) as requestedzethra
2016-11-08Merge remote-tracking branch 'upstream/master'zethra
2016-11-08Added documention to tcgetpgrp and tcsetpgrpzethra
2016-11-01unistd: doc updates based on review commentsPaul Osborne
These make the language consistent in the 3rd person, fix a few minor mistakes, and remove some superflous prose. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-29unistd: add module-level doc comment that makes sensePaul Osborne
The previous one was entirely too generic. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-29unistd: add documentation for the daemon functionPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-29unistd: add docs for exec* functionsPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-30Auto merge of #449 - posborne:documentation-improvements, r=kamalmarhubiHomu
Documentation improvements This series of commits starts to fill in documentation that was not previously present for various calls, mostly in unistd for this pass. r? @kamalmarhubi
2016-10-28remove extra line in the commitkiddkai
2016-10-28add getpgidkiddkai
2016-10-27unistd: add docs for chownPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-27unistd: add docs for chdirPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-27unistd: document the dup, dup2, and dup3 callsPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-27unistd: add documentation for gettidPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-27unistd: add setsid implementationPaul Osborne
This is a logical companion to setpgid, so adding an implementation. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-27unistd: add documentation for setpgidPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-27unistd: add docs for getpid/getppidPaul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-27unistd: add better docs for fork()Paul Osborne
Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-10-26Add setresuid and setresgidDylan Reid
These were both recently added to libc, add wrappers. Signed-off-by: Dylan Reid <dgreid@chromium.org> --- Changes since v2: Updated function comments and CHANGELOG Changes since v1: Add function comments, update CHANGELOG
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: