-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements flags checking for fork1 implementation (#1081)
- Loading branch information
1 parent
7c140d0
commit 829f54e
Showing
4 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// Value of *nix signal. | ||
#[derive(Debug, Clone, Copy)] | ||
pub struct Signal(u8); | ||
|
||
impl Signal { | ||
const MAX: u8 = 128; // _SIG_MAXSIG | ||
|
||
/// # Panics | ||
/// If `v` is not a valid signal number. | ||
pub const fn from_bits(v: u8) -> Self { | ||
assert!(v <= Self::MAX); | ||
Self(v) | ||
} | ||
|
||
pub const fn into_bits(self) -> u8 { | ||
self.0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters