Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viraptor/prctl-rs
Rust library providing the prctl abstraction
https://github.com/viraptor/prctl-rs
Last synced: about 2 months ago
JSON representation
Rust library providing the prctl abstraction
- Host: GitHub
- URL: https://github.com/viraptor/prctl-rs
- Owner: viraptor
- License: mit
- Created: 2014-12-11T06:19:00.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T22:58:20.000Z (over 1 year ago)
- Last Synced: 2024-11-15T19:39:35.134Z (about 2 months ago)
- Language: Rust
- Size: 13.7 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
prctl
=====Rust library providing the prctl abstraction
Module provides safe abstraction over the prctl interface.
Provided functions map to a single `prctl()` call, although some of them may be usable
only on a specific architecture or only with root privileges. All known enums that
may be used as parameters are provided in this crate.Each function provides result which will be `Err(errno)` in case the `prctl()` call fails.
To run tests requiring root privileges, enable feature "root_test".
Usage
=====Most functions set/get flags or set/get options. They can be used in the following way:
```
// Allow core dumping
!try(prctl::set_dumpable(true));// Get current timer slack
let slack = !try(prctl::get_timer_slack());// Send signal 6 after dying
!try(prctl::set_death_signal(6));// Set current process name
!try(prctl::set_name("new_process"));// Disable access to the timestamp counter
use prctl::PrctlTsc;
!try(prctl::set_tsc(PrctlTsc::PR_TSC_SIGSEGV));
```License
=======Licensed under [MIT license](LICENSE).