Age | Commit message (Collapse) | Author |
|
This patch adds a wrapper for the acct(2) syscall, with two functions
for enabling and disabling process accounting.
|
|
* 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.
|
|
|
|
This also adds a test for truncate (obviously) but, while doing so, also
adds a test for the already-existing ftruncate.
|
|
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.
|
|
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
|
|
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.
|
|
|
|
- init_module and finit_module to load kernel modules
- delete_module to unload kernel modules
Signed-off-by: Pascal Bach <pascal.bach@nextrem.ch>
|
|
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.
|
|
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).
|
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
|
|
921: Get `SO_PEERCRED` working on all Linux targets r=asomers a=jonas-schievink
These were disabled for ARM way back in 0db6ed1a28b4fb4d408cd9b7c4dba0a79bccf1f7 and 09c00ed7d9d92db2a79baa3ed212e7e239edceb9. Try to enable them for all arches and Android as well, since the removal wasn't really explained and I see no reason why this shouldn't work.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|
|
918: Fix passing multiple file descriptors / control messages via sendmsg r=asomers a=jonas-schievink
Fixes #464
Closes #874 because it's incorporated here
Closes #756 because it adds the test from that issue (with fixes)
Co-authored-by: alecmocatta <alec@mocatta.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rather than using the native implementation of these constants
on supported platforms, the native implementation was instead
emulated. This was also hidden from the user even though this
could result in data races and the functionality being broken.
Native functionality is, however, not support on macos/ios.
Rather than enable this emulation solely for this platform, it
should be removed as this is a dangerous abstraction.
|
|
|
|
893: Remove IFF_NOTRAILERS for openbsd r=asomers a=kpcyrd
nix currently doesn't compile on openbsd because `IFF_NOTRAILERS` isn't found. This PR fixes the openbsd build again (tested on 6.3). It seems it was changed in this commit:
https://github.com/openbsd/src/commit/beb8b0dd5985e55a615b52e593da6e75bab33f3f
Co-authored-by: kpcyrd <git@rxv.cc>
|
|
IFF_NOTRAILERS has been removed in OpenBSD 6.3
https://github.com/openbsd/src/commit/beb8b0dd5985e55a615b52e593da6e75bab33f3f
|
|
|
|
892: Fixed ptrace::Request cfg conditions r=asomers a=dalance
The cfg condition of ptrace::Request seems to be different from libc.
For example, PTRACE_GETREGS is defined by libc to i686-unknown-linux-gnu target, but it is not defined in ptrace::Request.
I tried to change the cfg condition to the same as libc's condition.
I thinks this change covers the definitions under src/unix/notbsd directory in libc repository.
Co-authored-by: dalance <dalance@gmail.com>
|
|
|
|
This is a straight port of @abbradar's work in #276, with
two (somewhat weak) tests and a bit of documentation.
|
|
|
|
|
|
While usually `ioctl()` passes a pointer, the function call has been
overloaded to allow integers to be passed. For some platforms this
is an `int` and on others it's a `ulong`.
Fixes #824.
|
|
ioctls on FreeBSD and DragonflyBSD have a separate request code generation
macro `_IOWINT` which is now exposed as `request_code_write_int`.
`ioctl_write_int` is also fixed on these platforms to use this new request
|
|
872: Change sys::aio::lio_listio to sys::aio::LioCb::listio r=asomers a=asomers
The new LioCb structure allows us to control the exact arguments passed
to lio_listio, guaranteeing that each call gets a unique storage
location for the list argument. This prevents clients from misusing
lio_listio in a way that causes events to get dropped from a kqueue
Fixes #870
|
|
876: add mlockall and munlockall r=asomers a=afck
Closes #875
|
|
|
|
|
|
Supporting the bytes crate was unnecessarily specific. This change
replaces from_bytes and from_bytes_mut with from_boxed_slice and
from_boxed_mut_slice, which can work with anything that implements
Borrow<[u8]> and BorrowMut<[u8]>, respectively.
|
|
The new LioCb structure allows us to control the exact arguments passed
to lio_listio, guaranteeing that each call gets a unique storage
location for the list argument. This prevents clients from misusing
lio_listio in a way that causes events to get dropped from a kqueue
Fixes #870
|
|
|
|
|
|
|
|
|
|
Fix markdown in the CHANGELOG
|
|
|
|
libc reads sys/statvfs.h on all OS except Windows which nix doesn't care
about.
Closes: https://github.com/nix-rust/nix/issues/831
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
Add Flags: `IFF_NO_PI`, `IFF_TUN`, `IFF_TAP`.
|
|
852: Add step function to ptrace r=Susurrus a=xd009642
Added step function to ptrace, this follows the same form as the PTRACE_CONTINUE by advanced the tracee by a single step!
Found when I was updating to nix 0.10.0 that this function had been missed out. Minor addition as `SINGLESTEP` works the same as `CONTINUE`
|
|
851: Added `getsid` in `::nix::unistd` r=asomers a=ggriffiniii
Resolves Issue #850
|