summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-23Merge #975bors[bot]
975: Add execvpe support, conditional on platform r=asomers a=F1rst-Unicorn This closes #682 Co-authored-by: F1rst-Unicorn <f1rst_unicorn@njsm.de>
2018-11-19Add execvpe support, conditional on platformF1rst-Unicorn
2018-11-16Merge #973bors[bot]
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>
2018-11-16CHANGELOG: move entry from #884 from 0.11.0 to unreleased where it belongs.Maciej Pasternacki
2018-11-09Merge #970bors[bot]
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>
2018-11-09Add example for setsockoptPovilas Balciunas
Makes it easier for newcomers :)
2018-11-08Merge #968bors[bot]
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>
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-11-05Merge #966bors[bot]
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>
2018-11-05Require Rust 1.24.1Bryant Mairs
lazy_static as of 1.2 requires Rust 1.24.1, so make that our minimum required version
2018-11-02Merge #962bors[bot]
962: exclude more CI files from crates.io r=asomers a=ignatenkobrain Co-authored-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-11-02exclude more CI files from crates.ioIgor Gnatenko
2018-11-02Merge #961bors[bot]
961: Add sync (fix #959) r=asomers a=r-darwish Co-authored-by: Roey Darwish Dror <roey.ghost@gmail.com>
2018-11-02Add sync (fix #959)Roey Darwish Dror
2018-10-30Merge #958bors[bot]
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>
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-24Merge #952bors[bot]
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>
2018-10-21Add acct(2) wrapper APIJosh Abraham
This patch adds a wrapper for the acct(2) syscall, with two functions for enabling and disabling process accounting.
2018-10-21Merge #949bors[bot]
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>
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-20Merge #955bors[bot]
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>
2018-10-19Add trivial tests for chown and fchownatJulio Merino
These are mostly to ensure that all the platforms we care about in our CI can reference these primitives.
2018-10-19Add a fchownat(2) wrapperJulio Merino
2018-10-19Merge #956bors[bot]
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>
2018-10-17Merge #940bors[bot]
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>
2018-10-18Document ioctl_param_typeRukai
2018-10-17Add a truncate(2) wrapperJulio Merino
This also adds a test for truncate (obviously) but, while doing so, also adds a test for the already-existing ftruncate.
2018-10-17Merge #954bors[bot]
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>
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-15Merge #953bors[bot]
953: Eliminate compiler warnings, especially on non-Linux platforms r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2018-10-15Eliminate compiler warnings, especially on non-Linux platformsAlan Somers
2018-10-15Merge #948bors[bot]
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>
2018-10-15socket: add AF_UNSPEC to AddressFamilyLevente Kurusa
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
2018-10-11Merge #950bors[bot]
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>
2018-10-09Fix #945 - documentation fixJosh Abraham
Correct references to user ids to group ids.
2018-10-04Merge #946bors[bot]
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>
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-30Merge #944bors[bot]
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>
2018-09-29Add wrappers for futimens(2) and utimesat(2)Julio Merino
2018-09-23Merge #930bors[bot]
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>
2018-09-05Add wrapper for linux kernel module loadingPascal Bach
- init_module and finit_module to load kernel modules - delete_module to unload kernel modules Signed-off-by: Pascal Bach <pascal.bach@nextrem.ch>
2018-09-05Refactor skip_if_not_root into macroPascal Bach
This macro can be used in tests to skip the test if it requires root to sucssfully run.
2018-09-05Replace allow unused directive with _ prefixPascal Bach
2018-09-05Update to rand 0.5 cratePascal Bach
This avoids having both 0.4 and 0.5 (required by tempfile)
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-09-04Merge #916bors[bot]
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>