summaryrefslogtreecommitdiff
path: root/src/sys/mod.rs
AgeCommit message (Collapse)Author
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.
2017-06-04Add pthread_selfking6cong
2016-12-16Add POSIX AIO supportAlan Somers
POSIX AIO is a standard for asynchronous file I/O. Read, write, and fsync operations can all take place in the background, with completion notification delivered by a signal, by a new thread, by kqueue, or not at all. This commit supports all standard AIO functions. However, lio_listio is disabled on macos because it doesn't seem to work, even though the syscall is present. The SigEvent class, used for AIO notifications among other things, is also added. Also, impl AsRef for TimeVal and TimeSpec
2016-12-10Add ioctl support for BSDConrad Kramer
2016-07-13Stop targeting AndroidSergey Bugaev
2016-07-13Add the initial implementation of reboot()Sergey Bugaev
2016-03-14Add context module.Philipp Matthias Schaefer
The module wraps context handling related functions and structs.
2016-02-12linux: Add sendfile(2)Kamal Marhubi
2015-12-03NetBSD tweaks for kqueue supportZachary Tong
2015-12-03Statvfs improvementsBrandon W Maister
* Implement `Default` * Add documentation * Add some convenience wrappers
2015-10-20Move a few bindings behind featuresCarl Lerche
2015-09-28statfs() & fstatfs()Alexander Polakov
2015-09-28quotactl() API for linuxAlexander Polakov
2015-09-28Add sys::select::FdSet and sys::select::select.Utkarsh Kukreti
2015-09-10Add signalfd supportAlex Gulyás
2015-09-09Add/Fix support for DragonFly BSDMichael Neumann
2015-08-25Add memfd functionalityDavid Henningsson
2015-07-03Add support for ptraceJoseph Kain
Closes #138
2015-05-29Basic OpenBSD support.Laurence Tratt
Some of the tests are currently unrunnable, but the basic library is at least buildable.
2015-05-11Get the library to build on freebsdAndrew J. Stone
`cargo build` works.
2015-04-08Bring back eventfd behind a feature flagCarl Lerche
At some point, feature flags will be switched to a conditional build system.
2015-04-06Get compiling on Rust 1.0 betaCarl Lerche
Initially support this by assuming the lowest common denominator. The long term solution is to improve the build system to allow pulling in more specific features that are available on the target system.
2015-03-13Amend some files to make it compile on arm-linux-androideabi.kennytm
2015-03-12Add TimeVal and helpersCarl Lerche
2015-02-25Large cleanup, mostly of socket functionsCarl Lerche
2015-02-21Fix uio and add SockAddr conversionsCarl Lerche
2015-02-17iOS: term support is really redundantValerii Hiora
2015-01-21Add `ioctl`. Only supports the `TIOCGWINSZ` request right now.Utkarsh Kukreti