summaryrefslogtreecommitdiff
path: root/src/sys
AgeCommit message (Collapse)Author
2019-01-23Add IP_RECVIF & IP_RECVDSTADDR.Tom Pusateri
Include IP_PKTINFO and IP6_PKTINFO on netbsd/openbsd.
2019-01-22add `mman::mprotect`Adam C. Foltzer
2019-01-15Fix build and tests issues on OpenBSD 6.4+Andrei-Marius Radu
1) lutimes doesn't exist on OpenBSD so it needs to be under conditional compilation. The only "reference" that I could find related to this is the discussion here: https://github.com/rust-lang/libc/pull/790 . 2) fexecve doesn't exist on OpenBSD so add conditional compilation for it in unistd and in related tests. The only "reference" that I could find is a mention that fexecve is not implemented on OpenBSD in the manual pages for signal(3) and sigaction(2): Official repository (search for "fexecve"): https://cvsweb.openbsd.org/src/lib/libc/sys/sigaction.2?rev=1.75&content-type=text/x-cvsweb-markup Github mirror: https://github.com/openbsd/src/blob/master/lib/libc/sys/sigaction.2#L619 3) AIO doesn't work on OpenBSD so put test_aio_drop under conditional compilation. 4) Add relevant changelog entries. P.S. On OpenBSD remains the issue of test_scm_rights which builds correctly but fails at runtime.
2019-01-13Implement nix wrapper for libc::signalRobert Gardner
Closes #476
2019-01-09Added ptrace getregs and setregsWill Povell
2019-01-06Make ScmTimestamp's doc test more robustAlan Somers
The old test made assumptions about the responsiveness of the test environment. The new test does not, and it's simpler too.
2018-12-17Merge #993bors[bot]
993: Don't reference packed structs. r=asomers a=pusateri Fixes #992. Don't merge this yet. I have more testing to do. I just am pushing it up for others. Co-authored-by: Tom Pusateri <pusateri@bangj.com>
2018-12-17Merge #990bors[bot]
990: Add cmsg PKTINFO for IPv4 and IPv6. r=asomers a=pusateri Replaces #891 and attempts to address all previous concerns. Co-authored-by: Tom Pusateri <pusateri@bangj.com>
2018-12-16Allow 'cargo test' to complete successfully on NetBSD 8.0.Tom Pusateri
Some tests have been disabled and will need further review.
2018-12-15Add cmsg PKTINFO for IPv4 and IPv6.Tom Pusateri
ignore pktinfo tests on qemu mips,mips64,powerpc64 Original work by @mcginty.
2018-12-08Replace try! with ?Alan Somers
try! is not available in Rust 2018
2018-12-06Add support of TCP_CONGESTION for setsockoptFensteer
2018-12-01Remove duplicate termios constantsBryant Mairs
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.
2018-12-01Add ioctl definitions for sparc64-linuxBryant Mairs
2018-12-01Fix missing SIGSTKFLT on sparc64-linuxBryant Mairs
2018-12-01Correct architecture checkBryant Mairs
2018-12-01Fix baud rate constants on sparc64-linuxBryant Mairs
2018-11-28Prefer `map(drop)` to `map(|_| ())`Alan Somers
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.
2018-11-27Merge #967bors[bot]
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>
2018-11-09Add example for setsockoptPovilas Balciunas
Makes it easier for newcomers :)
2018-11-07Add a wrapper for lutimes(2)Julio Merino
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.
2018-11-07Make sys::time::{time_t, suseconds_t} publicJulio Merino
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).
2018-10-28Removed Peek and poke user from unsupportedOpxd009642
2018-10-24Added AddressType typexd009642
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.
2018-10-21Added ptrace support for BSDsxd009642
* 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.
2018-10-19Add a fchownat(2) wrapperJulio Merino
2018-10-18Document ioctl_param_typeRukai
2018-10-16Make sys::stat::mode_t publicJulio Merino
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.
2018-10-15socket: add AF_UNSPEC to AddressFamilyLevente Kurusa
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
2018-10-02Add a wrapper for utimes(2)Julio Merino
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.
2018-09-29Add wrappers for futimens(2) and utimesat(2)Julio Merino
2018-09-05Merge #884bors[bot]
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>
2018-09-04impl FromStr and Display for sys::SignalBrandon W Maister
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.
2018-08-15sendmsg: remove unneeded mutIgor Gnatenko
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-07-27Fix *decoding* of cmsgs and add `ScmCredentials`.Jonas Schievink
2018-07-11Enable the select tests on powerpc and mipsJonas Schievink
They pass at least on my machine with QEMU, so the underlying bugs might have been fixed.
2018-07-05Merge #921bors[bot]
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>
2018-07-05Merge #918bors[bot]
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>
2018-07-05Get `SO_PEERCRED` working on all Linux targetsJonas Schievink
2018-07-04Add a sysinfo wrapperJonas Schievink
2018-07-04Clean up cmsg code and fix passing multiple cmsgsalecmocatta
2018-07-03Make preadv take immutable slice of IoVecs, fixes #913Jakub OkoĊ„ski
2018-06-03Fix compilation on aarch64-unknown-linux-muslBryant Mairs
2018-06-01Remove emulation of FD_CLOEXEC/O_NONBLOCKBryant Mairs
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.
2018-05-28Implement sendfile on FreeBSD and DarwinAndrew Morrow
2018-05-28Fix bind() on Android 64-bitBryant Mairs
libc fixed `bind()` for Android 64-bit targets, so change our code to match.
2018-05-22TypoXavier Bestel
2018-05-05Add documentation to signal-handling functionsRoss Light
2018-04-29Merge #892bors[bot]
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>
2018-04-29Enabled more ptrace::Request definitions for uncommon Linux platformsdalance