summaryrefslogtreecommitdiff
path: root/src/sys/mod.rs
AgeCommit message (Collapse)Author
2023-03-13Enable select on redoxNoa
2023-03-13Enable socket on redoxNoa
2023-02-09Rustier kqueue APIAlan Somers
* Prefer methods instead of functions. * Create a newtype for a kqueue. * Document everything. * Deprecate EVFILT_SENDFILE, because it was never fully implemented upstream. * Add support to the libc_enum! macro to be able to deprecate variants.
2022-09-07expose memfd on freebsdi509VCB
2022-07-26Fix typo guarding memfd export on android.Jason Heeris
2022-07-25Add memfd for target_os = "android"Felix Obenhuber
Memory fds (`memfd`) are implemented and exported by Androids bionic. Export the `memfd` module if the target os is `android`. https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/mman.h;drc=23c7543b8e608ebcbb38b952761b54bb56065577;bpv=1;bpt=1;l=182
2022-06-24Fix all formating problems to pass CI formating testCostin-Robert Sin
Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
2022-05-14add haiku supportAl Hoang
* enabled as much functionality and defines that match updated libc definitions for haiku
2022-04-09Use singular number for all feature namesAlan Somers
features => feature users => user Neither of these features have yet been included in a release, so it's ok to rename them.
2022-02-02Document timerfd.rsRyan Zoeller
2022-02-02Document reboot.rsRyan Zoeller
2022-02-02Document personality.rsRyan Zoeller
2022-02-02Document mman.rsRyan Zoeller
No documentation provided for MADV_CAN_REUSE, as Darwin doesn't actually document its functionality.
2022-01-31Document inotify.rsRyan Zoeller
2022-01-24uclibc supportJonah Petri
2022-01-03Add sendfile(2) for DragonFlyRyan Zoeller
2021-12-30Introduce timer_* supportBrian L. Troutwine
This commit adds support for the signal timer mechanism in POSIX, the mirror to timerfd on Linux. Resolves #1424 Signed-off-by: Brian L. Troutwine <brian@troutwine.us>
2021-12-20feature-gate most Nix functionsVincent Dagonneau
Using features reduces build time and size for consumer crates. By default all features are enabled.
2021-12-03Update `mman` related docsSachin Cherian
- Add docs for `memfd_create`, `shm_open`, and `shm_unlink` - Add man-page links - Remove` #[allow(missing_docs)]`on the `memfd` module
2021-09-12Merge #1509 #1515bors[bot]
1509: Allow Android to use timerfd r=asomers a=rtzoeller This is a continuation of #1336 which also enables the timerfd tests. ``` running 3 tests test sys::test_timerfd::test_timerfd_unset ... ok test sys::test_timerfd::test_timerfd_oneshot ... ok test sys::test_timerfd::test_timerfd_interval ... ok ``` 1515: Add IP_TTL/IPV6_UNICAST_HOPS SockOpts r=asomers a=cemeyer Test: `cargo test --test test test_ttl_opts` Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com> Co-authored-by: Conrad Meyer <cem@FreeBSD.org>
2021-09-04Document more thingsAlan Somers
Also, test rustdoc in CI, and demote missing_docs from a deny to a warning (but still deny it in CI).
2021-08-31Allow Android to use timerfdRyan Zoeller
Co-authored-by: zachoverflow <zach@zachjohnson.net>
2021-08-28More rust docsAlan Somers
Switch from allow(missing_docs) to deny(missing_docs), which should gradually help us moving forward. Also, add a few missing docs, such as for sched and aio.
2021-08-01Add getrlimit and setrlimitLMJW
This work is a continutation on previou contribution by @kpcyrd and @j1ah0ng.
2021-07-27Expose `sys::eventfd` for target_os = "android"Felix Obenhuber
Androids bionic supports eventfd. Extend the conditional compilation check to include the target_os "android". Fixes #1480
2021-03-21illumos and Solaris supportJason King
Co-authored-by: Dominik Hassler <hadfl@omnios.org> Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
2020-12-15feat(sys): High-level personality(2) wrappersWilliam Woodruff
Adds a high level `Persona` bitflags enum, as well as `personality::get()` and `personality::set()` for interacting with `libc::personality()`.
2020-07-07Adding an implementation and some basic tests for timerfd.Vincent Dagonneau
Removed support for timerfd on Android as it seems to have been deprecated? See https://android.googlesource.com/platform/development/+/73a5a3b/ndk/platforms/android-20/include/sys/timerfd.h or https://github.com/rust-lang/libc/issues/1589 Removed the public status of `TimerSpec`, as it should not be exposed to the user. Implemented `FromRawFd` for `TimerFd` as it already implements `AsRawFd`. Addressed comments from the latest code review: - Removed upper bound assertions on timer expirations in tests. - Made the main example runnable and added code to show how to wait for the timer. - Refactored `ClockId` to use `libc_enum`. - Added comments for all public parts of the module. - Wrapped to 80 cols. - Changed the size of the buffer in the tests to the minimum required. * Ran rustfmt. * Added a `From` implementation for `libc::timespec` -> `TimeSpec`. * Reworked the example with the new changes and changed the timer from 5 to 1 second. * Added a constructor for a 0-initialized `TimerSpec`. * Added a new method to get the timer configured expiration (based on timerfd_gettime). * Added an helper method to unset the expiration of the timer. * Added a `wait` method to actually read from the timer. * Renamed `settime` into just `set`. * Refactored the tests and added a new one that tests both the `unset` and the `get` method. Modified CHANGELOG.
2020-05-17Remove temporarily the failing tests for RedoxXavier L'Heureux
TODO: Fix them in Relibc
2020-05-17Add termio supportXavier L'Heureux
2020-05-17Add Redox support for most of the modulesXavier L'Heureux
Some things are not implemented yet in redox, so a lot of annotations were added to remove functions when compiling for redox. Those functions will hopefully be added in time, but for now it's better to have partial support than none. Blocked by https://github.com/rust-lang/libc/pull/1438
2019-06-12Update statfsalesharik
2019-02-21Added inotify bindings for Linux and Android.Vincent Dagonneau
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-07-04Add a sysinfo wrapperJonas Schievink
2018-05-28Implement sendfile on FreeBSD and DarwinAndrew Morrow
2018-04-10Refactor the ioctl API and documentationBryant Mairs
* Split `ioctl!` into separate macros. This makes documentation easier to read. * For every `ioctl_*!` macro include a description of the macro arguments as, the function prototype for the generated wrapper function, and an example if we have one. * Expose `request_code_*!` in the documentation to make the `ioctl_*_bad` macros easier to use. * Reorganize the file hierarchy to be simpler
2018-02-08make statfs/statvfs to be available wherever they are availableIgor Gnatenko
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>
2018-01-28Alphabetize modules under /sysBryant Mairs
2017-11-05Sort target OSes alphabeticallyBryant Mairs
2017-09-01Merge #750bors[bot]
750: Migrate quota module to libc FFI types r=asomers a=Susurrus
2017-08-29Migrate quota module to libc FFI typesBryant Mairs
2017-08-27Remove syscall module.Bryant Mairs
This module merely contained FFI declarations, and only enough to implement memfd_create() and pivot_root() wrapper functions in nix. Since these declarations are redundant with equivalent FFI declarations in libc, we'll remove them here. In the future, any syscall-related wrapper function will be implemented directly and utilize libc for FFI declarations as we cannot generically expose a type-safe `syscall()` because of its variadic argument list.
2017-08-21Expose signalfd on AndroidBryant Mairs
2017-08-21Log sendfile as missing for some BSDsBryant Mairs
2017-08-21Expose utsname on all platformsBryant Mairs
2017-07-18Remove signalfd feature in favor of conditional compilationBryant Mairs
Note that this is now only available for Linux as support is missing in libc for Android (see rust-lang/libc#671). As part of this work the SIGUSR2 signal mutex was altered to be a general signal mutex. This is because all signal handling is shared across all threads in the Rust test harness, so if you alter one signal, depending on whether it's additive or may overwrite the mask for other signals, it could break the other ones. Instead of putting this on the user, just broaden the scope of the mutex so that any altering of signal handling needs to use it.
2017-07-17Remove eventfd feature in favor of conditional includeBryant Mairs
2017-07-10Enable termios on iOS and move it to Tier 2Bryant Mairs
2017-07-08Enable ptrace on all Linux platformsGeoffrey Thomas
Nothing that nix currently binds is architecture-specific, and Android supports ptrace just as much as non-Android Linux.