31 releases (stable)

5.0.0 Sep 15, 2024
4.2.2 Aug 11, 2024
4.1.0 Feb 17, 2024
4.0.3 Mar 31, 2023
0.7.0 Mar 17, 2020

#72 in Operating systems

Download history 2307/week @ 2024-07-21 2118/week @ 2024-07-28 1892/week @ 2024-08-04 2946/week @ 2024-08-11 1671/week @ 2024-08-18 1771/week @ 2024-08-25 2169/week @ 2024-09-01 1794/week @ 2024-09-08 2177/week @ 2024-09-15 2047/week @ 2024-09-22 2262/week @ 2024-09-29 2168/week @ 2024-10-06 2705/week @ 2024-10-13 2313/week @ 2024-10-20 1946/week @ 2024-10-27 2035/week @ 2024-11-03

9,255 downloads per month
Used in 12 crates (8 directly)

MIT/Apache

68KB
1.5K SLoC

Process Control

This crate allows running a process with resource limits, such as a running time, and the option to terminate it automatically afterward. The latter is surprisingly difficult to achieve on Unix, since process identifiers can be arbitrarily reassigned when no longer used. Thus, it would be extremely easy to inadvertently terminate an unexpected process. This crate protects against that possibility.

Methods for setting limits are available on ChildExt, which is implemented for Child. They each return a builder of options to configure how the limit should be applied.

Warning: This crate should not be used for security. There are many ways that a process can bypass resource limits. The limits are only intended for simple restriction of harmless processes.

GitHub Build Status

Usage

Add the following lines to your "Cargo.toml" file:

[dependencies]
process_control = "5.0"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.75.0.

Minor version updates may increase this version requirement. However, the previous two Rust releases will always be supported. If the minimum Rust version must not be increased, use a tilde requirement to prevent updating this crate's minor version:

[dependencies]
process_control = "~5.0"

License

Licensing terms are specified in COPYRIGHT.

Unless you explicitly state otherwise, any contribution submitted for inclusion in this crate, as defined in LICENSE-APACHE, shall be licensed according to COPYRIGHT, without any additional terms or conditions.

Third-party content

This crate includes copies and modifications of content developed by third parties:

  • src/unix/read.rs and src/windows/read.rs contain modifications of code from The Rust Programming Language, licensed under the MIT License or the Apache License, Version 2.0.

See those files for more details.

Copies of third-party licenses can be found in LICENSE-THIRD-PARTY.

Dependencies

~0–8MB
~60K SLoC