Age | Commit message (Collapse) | Author |
|
|
|
try! is not available in Rust 2018
|
|
972: Add support of TCP_CONGESTION for setsockopt r=asomers a=Fensteer
Implementation proposal for support of TCP_CONGESTION param for `setsockopt`and `getsockopt` with the CString type.
Co-authored-by: Fensteer <fensteer@protonmail.com>
|
|
|
|
989: DragonflyBSD: Remove unused Errno's r=asomers a=levex
EUNUSED* were removed from <sys/errno.h> in DragonflyBSD, so there is no
need for them to be in nix either. This also fixes the build on
DragonflyBSD.
r? @asomers
cc/ @mneumann
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
Co-authored-by: Levente Kurusa <lkurusa@acm.org>
|
|
EUNUSED* were removed from <sys/errno.h> in DragonflyBSD, so there is no
need for them to be in nix either. This also fixes the build on
DragonflyBSD.
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
|
|
These constants have the same value on sparc64, so need to be removed as enums
in Rust can't have multiple names for the same value.
|
|
|
|
|
|
|
|
|
|
I previously advocated for the latter syntax on stylistic grounds. But
it generates less efficient code, because it creates a new lambda
function for each usage. The optimizer does not combine them. This
change saves about 6KB of code.
|
|
977: Error as i32 r=asomers a=asomers
Add Error::as_errno
This method is useful when it can be statically determined that a nix::Error be an errno, which I find to be very common.
Also, fix some recently introduced compiler warnings.
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
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>
|
|
This method is useful when it can be statically determined that a
nix::Error be an errno, which I find to be very common.
|
|
|
|
Makes it easier for newcomers :)
|
|
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).
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
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>
|
|
|
|
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>
|
|
Correct references to user ids to group ids.
|
|
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>
|
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
|
|
They pass at least on my machine with QEMU, so the underlying bugs might
have been fixed.
|
|
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.
|