Age | Commit message (Collapse) | Author |
|
967: Add a wrapper for lutimes(2) r=asomers a=jmmv
PR #944 added wrappers for the more-modern futimens(2) and utimesat(2),
but unfortunately these APIs are not available on old-ish systems.
In particular, macOS Sierra and below don't implement them, making the
new APIs unusable. Whether we should care about such "old" systems is
debatable, but the problem is that, at the moment, this is the only
macOS version usable on Travis to test kexts and, thus, to test FUSE
file systems.
This should have been part of PR #946, which added a wrapper for
utimes(2) following this same rationale, but missed lutimes(2) because
I simply didn't notice it existed.
Co-authored-by: Julio Merino <julio@meroh.net>
|
|
975: Add execvpe support, conditional on platform r=asomers a=F1rst-Unicorn
This closes #682
Co-authored-by: F1rst-Unicorn <f1rst_unicorn@njsm.de>
|
|
|
|
973: CHANGELOG: move entry from #884 from 0.11.0 to [Unreleased] r=asomers a=mpasternacki
PR #884 added changelog entry in section for 0.11.0, which has been already released, instead of in the [Unreleased] section (which wasn't present yet). Moved the entry where it belongs.
Co-authored-by: Maciej Pasternacki <maciej@3ofcoins.net>
|
|
|
|
970: Add example for setsockopt r=asomers a=povilasb
> Every great project needs great documentation
...one step at a time though :)
Co-authored-by: Povilas Balciunas <balciunas90@gmail.com>
|
|
Makes it easier for newcomers :)
|
|
968: Make sys::time::{time_t, suseconds_t} public r=asomers a=jmmv
This allows handling the return values of other public functions
(such as TimeVal's tv_sec and tv_usec) without having to pull in
these types from libc (which is ugly if a project is trying to
use nix exclusively to avoid libc's unsafety).
Co-authored-by: Julio Merino <julio@meroh.net>
|
|
PR #944 added wrappers for the more-modern futimens(2) and utimesat(2),
but unfortunately these APIs are not available on old-ish systems.
In particular, macOS Sierra and below don't implement them, making the
new APIs unusable. Whether we should care about such "old" systems is
debatable, but the problem is that, at the moment, this is the only
macOS version usable on Travis to test kexts and, thus, to test FUSE
file systems.
This should have been part of PR #946, which added a wrapper for
utimes(2) following this same rationale, but missed lutimes(2) because
I simply didn't notice it existed.
|
|
This allows handling the return values of other public functions
(such as TimeVal's tv_sec and tv_usec) without having to pull in
these types from libc (which is ugly if a project is trying to
use nix exclusively to avoid libc's unsafety).
|
|
966: Require Rust 1.24.1 r=asomers a=Susurrus
`lazy_static` as of 1.2 requires Rust 1.24.1, so make that our minimum required. This was discovered when I looked into the failures of #965.
@asomers if you agree with this change, could you update the buildbots here too?
Co-authored-by: Bryant Mairs <bryantmairs@google.com>
|
|
lazy_static as of 1.2 requires Rust 1.24.1, so make that our minimum required version
|
|
962: exclude more CI files from crates.io r=asomers a=ignatenkobrain
Co-authored-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
|
|
961: Add sync (fix #959) r=asomers a=r-darwish
Co-authored-by: Roey Darwish Dror <roey.ghost@gmail.com>
|
|
|
|
958: Added AddressType type to ptrace::linux + peek/poke user fix r=asomers a=xd009642
This was added to the BSD ptrace API and probably should have been added to the linux API to make it easier to write code for both platforms without the user having to reexport the types to their own crate.
I went to use the latest nix myself and found that having this added would improve usability for nix users.
Could potentially add a type for what they return (BSDs: `c_int`, linux: `c_long`). Data input might be trickier as linux is `*mut c_void` and BSD just takes data as `c_int`.
Co-authored-by: xd009642 <danielmckenna93@gmail.com>
|
|
|
|
This was added to the BSD ptrace API and probably should have been added to tyhe linux API to make it easier to write code for both platforms without the user having to reexport the types to their own crate.
|
|
952: Add wrapper for acct(2) r=asomers a=jabedude
This PR aims to add a nix wrapper for acct(2).
Co-authored-by: Josh Abraham <sinisterpatrician@gmail.com>
|
|
This patch adds a wrapper for the acct(2) syscall, with two functions
for enabling and disabling process accounting.
|
|
949: ptrace support for BSDs r=Susurrus a=xd009642
This PR adds support to the ptrace API for BSDs to close #947. It also adds a read and write method for reading and writing to a traced processes memory. The ptrace API created for linux offers this via a deprecated function so I added this so they can be feature equivalent without replicating a deprecated part of the API.
Due to the differences in ptrace on BSD and linux I've made a ptrace module to keep things readable.
Still to do - revert travis config to remove my feature branch and update the changelog.
Co-authored-by: xd009642 <danielmckenna93@gmail.com>
|
|
* Moved ptrace API into it's own module with cfg'ed modules exported for linux/android or BSDs.
* Replicated current linux API for BSD
* Added API functions to peek and poke memory to avoid needing to replicate deprecated linux API and remaining feature complete
* Added helper function for `PTRACE_KILL` requests
* Updated tests based on new API changes
* Added addition kill calls to `test_ptrace_cont` as inferior death doesn't happen immediately on OSX which caused issues in the tests.
|
|
955: Add a fchownat(2) wrapper r=asomers a=jmmv
Co-authored-by: Julio Merino <julio@meroh.net>
Co-authored-by: Julio Merino <jmmv@google.com>
|
|
These are mostly to ensure that all the platforms we care about in our
CI can reference these primitives.
|
|
|
|
956: Add a truncate(2) wrapper r=asomers a=jmmv
This also adds a test for truncate (obviously) but, while doing so, also
adds a test for the already-existing ftruncate.
Co-authored-by: Julio Merino <julio@meroh.net>
|
|
940: Document ioctl_param_type r=asomers a=rukai
Currently the docs claim ioctl_param_type to always be libc::c_int which is not the case on linux.
Also removes an unused import that was triggering a warning.
Co-authored-by: Rukai <rubickent@gmail.com>
|
|
|
|
This also adds a test for truncate (obviously) but, while doing so, also
adds a test for the already-existing ftruncate.
|
|
954: Make sys::stat::mode_t public r=asomers a=jmmv
This allows using e.g. sys::stat::Mode::from_bits() without having to
pull the mode_t type from libc (which is ugly if a project is trying
to use nix exclusively to avoid libc's unsafety).
This change mimics dev_t which was already exposed as public.
Co-authored-by: Julio Merino <julio@meroh.net>
|
|
This allows using e.g. sys::stat::Mode::from_bits() without having to
pull the mode_t type from libc (which is ugly if a project is trying
to use nix exclusively to avoid libc's unsafety).
This change mimics dev_t which was already exposed as public.
|
|
953: Eliminate compiler warnings, especially on non-Linux platforms r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
948: socket: add AF_UNSPEC to AddressFamily r=asomers a=levex
Hi!
I work on a [crate](https://github.com/levex/network-bridge-rs) where it would make sense to use `AF_UNSPEC` in place of `AF_INET`, since that's the API most bridge libraries use. Unfortunately, it seems that `nix` is missing a representation for `AF_UNSPEC`. This PR adds `Unspec` to `AddressFamily`, so we can now represent `AF_UNSPEC`.
Co-authored-by: Levente Kurusa <lkurusa@acm.org>
|
|
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
|
|
950: Fix #945 - documentation fix r=Susurrus a=jabedude
Correct references to user ids to group ids. Fixes #945
Co-authored-by: Josh Abraham <sinisterpatrician@gmail.com>
|
|
Correct references to user ids to group ids.
|
|
946: Add a wrapper for utimes(2) r=asomers a=jmmv
PR #944 added wrappers for the more-modern futimens(2) and utimesat(2),
but unfortunately these APIs are not available on old-ish systems.
In particular, macOS Sierra and below don't implement them, making the
new APIs unusable. Whether we should care about such "old" systems is
debatable, but the problem is that, at the moment, this is the only
macOS version usable on Travis to test kexts and, thus, to test FUSE
file systems.
Co-authored-by: Julio Merino <julio@meroh.net>
|
|
PR #944 added wrappers for the more-modern futimens(2) and utimesat(2),
but unfortunately these APIs are not available on old-ish systems.
In particular, macOS Sierra and below don't implement them, making the
new APIs unusable. Whether we should care about such "old" systems is
debatable, but the problem is that, at the moment, this is the only
macOS version usable on Travis to test kexts and, thus, to test FUSE
file systems.
|
|
944: Add wrappers for futimens(2) and utimesat(2) r=asomers a=jmmv
Hello again!
Let's see how this looks like. I don't think there is any other way of doing this via the standard library, though I see there is a `filetime` crate in the Rust nursery to add this missing functionality. Not sure what your policy for adding features into `nix` is.
Co-authored-by: Julio Merino <jmmv@google.com>
|
|
|
|
930: Add wrapper for linux kernel module loading r=Susurrus a=bachp
- init_module and finit_module to load kernel modules
- delete_module to unload kernel modules
Co-authored-by: Pascal Bach <pascal.bach@nextrem.ch>
|
|
- init_module and finit_module to load kernel modules
- delete_module to unload kernel modules
Signed-off-by: Pascal Bach <pascal.bach@nextrem.ch>
|
|
This macro can be used in tests to skip the test if it requires root to sucssfully run.
|
|
|
|
This avoids having both 0.4 and 0.5 (required by tempfile)
|
|
884: impl FromStr for sys::Signal r=Susurrus a=quodlibetor
This implements both ALLCAPS and lowercase full name (including SIG) and short
name.
This matches what `kill` accepts in many shells, and it also allows the `Debug`
representation of `Signal`, which means it can be round-tripped, if desired.
Co-authored-by: Brandon W Maister <quodlibetor@gmail.com>
|
|
This is a subset of what `kill` accepts in many shells. The Display
implementation matches the `Debug` representation of `Signal`.
The `FromStr` matches both Debug/Display which means it can be round-tripped,
if desired.
|
|
916: new dir module r=Susurrus a=scottlamb
Fixes #915
This is a lower-level interface than `std::fs::ReadDir`. Notable differences:
* can be opened from a file descriptor (as returned by `openat`, perhaps
before knowing if the path represents a file or directory). Uses
`fdopendir` for this, available on all Unix platforms as of
rust-lang/libc#1018.
* implements `AsRawFd`, so it can be passed to `fstat`, `openat`, etc.
* can be iterated through multiple times without closing and reopening the
file descriptor. Each iteration rewinds when finished.
* returns entries for `.` (current directory) and `..` (parent directory).
* returns entries' names as a `CStr` (no allocation or conversion beyond
whatever libc does).
Co-authored-by: Scott Lamb <slamb@slamb.org>
|