Commit Graph

17 Commits

Author SHA1 Message Date
Dan Gohman 4e2599b729 Run the tests on Rust 1.48, and check compilation of tests and examples on more targets (#465)
* Fix the tests to run on 1.48.

This puts the benchmarks behind a `criterion` cfg, so add
`--cfg=criterion` to RUSTFLAGS when running cargo bench.

An MSRV of 1.48 enables us to support users such as async-io, which also
has an MSRV of 1.48.

* Add a rust-version field.

This prints a warning under Rust 1.48, but only when rustix is the
top-level build; when rustix is a dependency, it doesn't warn, so this
seems ok.
2022-12-01 11:42:09 -08:00
Dan Gohman 8fca74091c Tidy up cfgs. 2022-11-28 08:58:36 -08:00
Dan Gohman a4434a6c12 Fix various compilation errors on haiku. (#411)
This builds on top of #407!
2022-09-25 18:20:34 -07:00
Dan Gohman e5d9aa159f More fixes for compilation on x86_64-unknown-dragonfly. (#410)
Add a tier-3 CI check for x86_64-unknown-dragonfly, and fix the
compilation errors needed to compile with --features=all-apis.

This builds on top of #409!
2022-09-25 13:15:28 -07:00
Koutheir Attouchi 974f83d24b Add support for setns(). (#398) 2022-09-20 10:15:24 -07:00
Koutheir Attouchi e328c738bc Add support for prctl(). 2022-09-16 07:14:37 -07:00
Dan Gohman d8a8fb9658 Fail with INVAL when tv_nsec requests are out of range. 2022-06-14 16:19:44 -07:00
Dan Gohman 243e8c5197 Rename rustix::io::Error to rustix::io::Errno.
Fixes #254.
2022-05-16 04:00:10 -07:00
Dan Gohman a946a14762 Put net, time, and other parts of the API behind feature flags (#297)
* Introduce API features.

* Don't use doc_cfg on internal modules.

* Don't compile the net code when the "net" feature is not present.

* Don't compile the runtime code when the "runtime" feature is not present.

* Don't compile the thread code when the "thread" feature is not present.

* Don't compile the time code when the "time" feature is not present.

* Don't compile the fs code when the "fs" feature is not present.

* Don't compile the rand code when the "rand" feature is not present.

* Split an "mm" feature out of the "io" module.

* Make some parts of "process"' implementation conditional.

* "Inline" the use declarations in src/imp/linux_raw/fs/mod.rs.

* Export `Timespec` and `ClockId` in `crate::thread`.

* io_uring depends on types from fs and net.

* Re-export Timespec etc. in crate::fs and crate::thread.

This makes it easier to disable crate::time when the time module is not
enabled.

* Ensure that tests and examples compile when features are disabled.

* Fix compilation.
2022-05-02 10:54:40 -07:00
Dan Gohman f7e4c56df5 Write more comments.
Make a pass over the crate adding and cleanup up comments and doc aliases.
2022-01-19 12:44:26 -08:00
Dan Gohman e334397b90 Split time/process/io/thread/rand syscalls into separate files.
In the linux_raw backend, split out the time, process, io, thread, and
rand syscalls from the large central syscalls.rs, into separate files.

The libc backend already had most of these these split out into separate
files, so in the libc backend this just splits out the rand syscalls,
so that the two backends have the same structure.

This also tidyies up `use` statements across all the syscalls.rs files.
2022-01-19 06:40:07 -08:00
Dan Gohman 71a3f2d4d3 Make Pid a non-zero type. (#136)
Make `Pid` a non-zero type and use `Option<Pid>` in places where a pid
value can be zero.  This lets `fork`'s API use an `Option` instead of a
sentry value, which is cleaner.
2021-12-03 19:59:05 -08:00
Dan Gohman 06f7719767 Move the nanosleep functions to rustix::thread. (#127)
Previously these were in rustix::time, however std has `std::thread::sleep`,
so move Rustix's sleep functions accordingly.
2021-11-29 15:39:51 -08:00
Dan Gohman 4ef8c6a1d6 Rename rsix to rustix.
Fixes #98.
2021-11-04 15:16:20 -07:00
Dan Gohman 57b7f4f628 Winsock support.
The Windows Winsock API provides an API similar enough to POSIX-style
sockets that it's supportable within rsix.
2021-11-02 04:19:27 -07:00
Dan Gohman 5849e100ad Add Uid, Gid, and Pid wrapper types.
Inspired by [nix's similar feature], this extends the idea of hiding
plain integer values when they represent mostly meaningless identifiers.

[nix's similar feature]: https://docs.rs/nix/0.22.1/nix/unistd/struct.Pid.html
2021-09-01 11:18:44 -07:00
Dan Gohman ba37de346e Add a thread module and define gettid. 2021-08-26 09:07:21 -07:00