Age | Commit message (Collapse) | Author |
|
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.
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
|
The previous one was entirely too generic.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
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
|
|
|
|
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
This is a logical companion to setpgid, so adding an implementation.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
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
|
|
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
|
|
|
|
OsString::from_vec on existing path var rather than construct string from pointer
|
|
readability
|
|
*mut u8 whereas x86_64 and i686 expect it to be *mut i8)
|
|
|
|
|
|
|
|
1.2.0 error in doc-test
|
|
|
|
against std::env::current_dir
|
|
|
|
the implementation in std
|
|
|
|
expect into proper try handling), needs testing still
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
fixed a few clippy warnings
Just a few style nits. Hope it'll be useful anyway :smile:
|
|
|
|
|