summaryrefslogtreecommitdiff
path: root/src/sched.rs
AgeCommit message (Collapse)Author
2022-11-06Reformat everythingAlex Saveau
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-09-27Add a `sched_getcpu` wrapperJonas Schievink
2022-08-25Add sched_getaffinity and sched_setaffinity on FreeBSDRyan Zoeller
2022-08-09remove deprecated itemsSteveLauC
2021-12-22Enable sched_get/setaffinity on DragonFly BSDRyan Zoeller
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-09-19Clippy cleanupAlan Somers
And this time, start running Clippy in CI
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-07-24Constify many functionsAlan Somers
Constify most functions that can be constified. The exceptions are mostly accessors for structs that have no const constructor.
2021-07-07Overhaul Nix's error typesAlan Somers
For many of Nix's consumers it be convenient to easily convert a Nix error into a std::io::Error. That's currently not possible because of the InvalidPath, InvalidUtf8, and UnsupportedOperation types that have no equivalent in std::io::Error. However, very few of Nix's public APIs actually return those unusual errors. So a more useful API would be for Nix's standard error type to implement Into<std::io::Error>. This commit makes Error a simple NewType around Errno. For most functions it's a drop-in replacement. There are only three exceptions: * clearenv now returns a bespoke error type. It was the only Nix function whose error couldn't be cleanly mapped onto an Errno. * sys::signal::signal now returns Error(Errno::ENOTSUP) instead of Error::UnsupportedOperation when the user passes an incompatible argument to `handler`. * When a NixPath exceeds PATH_MAX, it will now return Error(Errno::ENAMETOOLONG) instead of Error::InvalidPath. In the latter two cases there is now some abiguity about whether the error code was generated by Nix or by the OS. But I think the ambiguity is worth it for the sake of being able to implement Into<io::Error>. This commit also introduces Error::Sys() as a migration aid. Previously that as an enum variant. Now it's a function, but it will work in many of the same contexts as the original. Fixes #1155
2021-06-12wordsmithing on sched::cloneAlan Somers
2021-06-12Add documentation for sched::cloneKonstantinos Andrikopoulos
Add a note in the documentation for sched::clone to point out that the stack pointer does not neet to be a reference to the highest address of the stack. Users who simply read the manpages for clone(2) might assume that they will need to use unsafe pointer arithmetics in order to create a reference to the highest address of their buffer, rather than providing their buffer directly.
2021-05-13Use https instead of httpRyan Zoeller
2020-06-27misc clippy cleanupAlan Somers
2020-06-27implement `Default` for `CpuSet`.Alan Somers
2020-05-31Convert the crate to edition 2018Alan Somers
2019-11-21Implement sched::sched_getaffinity()Thibaut Ackermann
sched_getaffinity(2) get a process's CPU affinity mask
2019-07-13Fix warnings on Rust 1.37.0Alan Somers
* Replace obsolete range syntax "..." with inclusive range "..=" * Use dyn Trait syntax instead of Box<Trait> * Raise MSRV to 1.27.0 (for dyn Trait syntax) * Raise MSRV to 1.31.0 (because of rand) tempfile pulls in rand, and rand pulls in fuchsia-cprng, which requires 1.31.0. Why rand pulls in fuchsia-cprng I don't know. It's specified as a target-specific dependency, but Cargo tries to build it anyway (only on Linux, not on FreeBSD or OSX). A bug in Cargo 1.27.0?
2019-07-01Enable sched_yield for all *nix hostsJakub Konka
2019-07-01Move cross compilation cfg for sched into sched modJakub Konka
2019-06-09Add extra traits for all typesBryant Mairs
Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all traits are supported by all types, which is why many are missing some.
2019-05-17Implement `sched_yield`.Dan Gohman
This adds the `sched_yield` function, which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html and widely implemented on Unix-family platforms.
2018-01-28Require Debug impls for all typesBryant Mairs
2018-01-28Deny unused qualificationsBryant Mairs
2017-12-04Stop reexporting `Errno` and its variantsJonas Schievink
cc #664 (unsure if this is everything needed)
2017-08-26Use libc types for sched FFIBryant Mairs
2017-08-17Merge #725bors[bot]
725: Match syntax of libc_bitflags! with bitflags! r=asomers Also update a couple of constant declarations while we're at it.
2017-08-16Match libc_bitflags! syntax to upstream bitflags!Bryant Mairs
2017-08-11Get rid of a lot of transmutesJonas Schievink
Most could be replaced by simple raw pointer casts (or even perfectly safe coercions!). cc #373
2017-07-02Newtypes for uid_t, gid_t and pid_t.Martin Habovštiak
2017-06-15Change sched_setaffinity's PID argument to pid_tJulian Squires
The officially documented type, and the type in sched.h, for this argument is pid_t.
2017-02-16Update bitflags to 0.7Simon Sapin
2016-12-11Ensure child stack passed to clone is 16 byte aligned.Kevin DeJong
2016-11-03Add CLONE_NEWCGROUPDylan Reid
2016-08-29Replace parts of ffi module by libc functions in sched.rsPhilipp Matthias Schaefer
2016-04-21Allow to specify signal when calling clone.Philipp Matthias Schaefer
2016-04-14Cast function item to function pointer in order to appease compiler.Philipp Matthias Schaefer
This is necessary because of compiler changes. For further information look at rust-lang/rust#19925.
2016-03-07Add support for MIPS targetsGabriele Svelto
Closes #300
2016-01-28Convert CLONE_ flags to bitflags! type.Philipp Matthias Schaefer
2016-01-28Move errno::Result back to crate rootarcnmx
2016-01-28Errno::result()arcnmx
2016-01-18setnsarcnmx
2016-01-15add aarch64 supportBrian Martin
2015-12-22Fix build on Linux & Rust nightlyCarl Lerche
2015-08-22Fix signature of linux `clone` functionPaul Colomiets
In fact function returns pid of new process (or tid of new thread)
2015-04-24sched: add support for arm linux using same cpuset_attribs as androidPaul Osborne
The limit of 32 cores may not actually be a limit with arm-linux, but I am not aware of anything in excess of 32 processors out there currently and this is what I have been running for awhile now on a beaglebone black (`--target=arm-unknown-linux-gnueabihf`). This change addresses #95 and relates to #97.
2015-04-03'derive(Copy)' needs Clone nowFlorian Hartwig
2015-03-24NixResult -> nix::Result; NixError -> nix::ErrorCarl Lerche
2015-03-16Fix deprecation warningsCarl Lerche
2015-03-13Amend some files to make it compile on arm-linux-androideabi.kennytm