-
Notifications
You must be signed in to change notification settings - Fork 677
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
681: Remove feature flags r=Susurrus These are vestiges of the initial push to get this working on Rust 1.0. These feature flags are undocumented and so hard to discover (only learned about them today!), prevent functions being included that should be and this also affects documentation on docs.rs, and none of the features are tested in CI and the `execvpe` has been broken for forever. The solution is to conditionally compile everything supported for a given platform and do away completely with the feature flags. The `execvpe` function is completely removed as it's not available for *nix platforms in libc and is already broken, so no loss removing it. We'll add it back once it's back in libc (rust-lang/libc#670). Closes #98. Closes #206. Closes #306. Closes #308.
- Loading branch information
Showing
14 changed files
with
49 additions
and
92 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
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
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,26 @@ | ||
#[test] | ||
fn test_signalfd() { | ||
use nix::sys::signalfd::SignalFd; | ||
use nix::sys::signal::{self, raise, Signal, SigSet}; | ||
|
||
// Grab the mutex for altering signals so we don't interfere with other tests. | ||
#[allow(unused_variables)] | ||
let m = ::SIGNAL_MTX.lock().expect("Mutex got poisoned by another test"); | ||
|
||
// Block the SIGUSR1 signal from automatic processing for this thread | ||
let mut mask = SigSet::empty(); | ||
mask.add(signal::SIGUSR1); | ||
mask.thread_block().unwrap(); | ||
|
||
let mut fd = SignalFd::new(&mask).unwrap(); | ||
|
||
// Send a SIGUSR1 signal to the current process. Note that this uses `raise` instead of `kill` | ||
// because `kill` with `getpid` isn't correct during multi-threaded execution like during a | ||
// cargo test session. Instead use `raise` which does the correct thing by default. | ||
raise(signal::SIGUSR1).ok().expect("Error: raise(SIGUSR1) failed"); | ||
|
||
// And now catch that same signal. | ||
let res = fd.read_signal().unwrap().unwrap(); | ||
let signo = Signal::from_c_int(res.ssi_signo as i32).unwrap(); | ||
assert_eq!(signo, signal::SIGUSR1); | ||
} |
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
This file was deleted.
Oops, something went wrong.
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