clock.rs |
|
3613 |
futex.rs |
Linux `futex`.
Futex is a very low-level mechanism for implementing concurrency primitives
such as mutexes, rwlocks, and condvars.
# Examples
```
use rustix::thread::futex;
use std::sync::atomic::AtomicU32;
# fn test(futex: &AtomicU32) -> rustix::io::Result<()> {
// Wake up one waiter.
futex::wake(futex, futex::Flags::PRIVATE, 1)?;
# Ok(())
# }
```
# References
- [Linux `futex` system call]
- [Linux `futex` feature]
[Linux `futex` system call]: https://man7.org/linux/man-pages/man2/futex.2.html
[Linux `futex` feature]: https://man7.org/linux/man-pages/man7/futex.7.html |
15287 |
id.rs |
|
4926 |
libcap.rs |
|
7516 |
mod.rs |
Thread-associated operations. |
2633 |
prctl.rs |
Linux `prctl` wrappers.
Rustix wraps variadic/dynamic-dispatch functions like `prctl` in type-safe
wrappers.
# Safety
The inner `prctl` calls are dynamically typed and must be called correctly. |
37412 |
setns.rs |
/bitflags/#externally-defined-flags>
const _ = !0;
}
}
/// Type of name space referred to by a link.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[repr(u32)]
pub enum LinkNameSpaceType {
/// Time name space.
Time = CLONE_NEWTIME,
/// Mount name space.
Mount = CLONE_NEWNS,
/// Control group (CGroup) name space.
ControlGroup = CLONE_NEWCGROUP,
/// `Host name` and `NIS domain name` (UTS) name space.
HostNameAndNISDomainName = CLONE_NEWUTS,
/// Inter-process communication (IPC) name space.
InterProcessCommunication = CLONE_NEWIPC,
/// User name space.
User = CLONE_NEWUSER,
/// Process ID name space.
ProcessID = CLONE_NEWPID,
/// Network name space.
Network = CLONE_NEWNET,
}
bitflags! {
/// `CLONE_*` for use with [`unshare`].
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct UnshareFlags: u32 {
/// `CLONE_FILES`.
const FILES = CLONE_FILES;
/// `CLONE_FS`.
const FS = CLONE_FS;
/// `CLONE_NEWCGROUP`.
const NEWCGROUP = CLONE_NEWCGROUP;
/// `CLONE_NEWIPC`.
const NEWIPC = CLONE_NEWIPC;
/// `CLONE_NEWNET`.
const NEWNET = CLONE_NEWNET;
/// `CLONE_NEWNS`.
const NEWNS = CLONE_NEWNS;
/// `CLONE_NEWPID`.
const NEWPID = CLONE_NEWPID;
/// `CLONE_NEWTIME`.
const NEWTIME = CLONE_NEWTIME;
/// `CLONE_NEWUSER`.
const NEWUSER = CLONE_NEWUSER;
/// `CLONE_NEWUTS`
const NEWUTS = CLONE_NEWUTS;
/// `CLONE_SYSVSEM`.
const SYSVSEM = CLONE_SYSVSEM;
/// <https://docs.rs/bitflags/ |
4365 |