make multicore optional
This commit is contained in:
parent
a6294af2c3
commit
5d08f3a9d7
@ -302,7 +302,7 @@ fn fuzz(
|
|||||||
});
|
});
|
||||||
|
|
||||||
//====== Child Function
|
//====== Child Function
|
||||||
let mut run_client = |state: Option<StdState<_, _, _, _, _>>, mut mgr, _core_id| {
|
let mut run_client = |state: Option<StdState<_, _, _, _, _>>, mut mgr, _core_id| -> std::result::Result<(), libafl::Error> {
|
||||||
|
|
||||||
//====== Set up Emu and termination-point
|
//====== Set up Emu and termination-point
|
||||||
let emu = Emulator::new(&args, &env);
|
let emu = Emulator::new(&args, &env);
|
||||||
@ -467,6 +467,7 @@ fn fuzz(
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let file_null = File::open("/dev/null")?;
|
let file_null = File::open("/dev/null")?;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
#[cfg(feature = "multicore")]
|
||||||
{
|
{
|
||||||
let null_fd = file_null.as_raw_fd();
|
let null_fd = file_null.as_raw_fd();
|
||||||
dup2(null_fd, io::stdout().as_raw_fd())?;
|
dup2(null_fd, io::stdout().as_raw_fd())?;
|
||||||
@ -482,6 +483,9 @@ fn fuzz(
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Multicore Variant
|
||||||
|
#[cfg(feature = "multicore")]
|
||||||
|
{
|
||||||
match Launcher::builder()
|
match Launcher::builder()
|
||||||
.shmem_provider(shmem_provider)
|
.shmem_provider(shmem_provider)
|
||||||
.configuration(EventConfig::AlwaysUnique)
|
.configuration(EventConfig::AlwaysUnique)
|
||||||
@ -499,3 +503,12 @@ fn fuzz(
|
|||||||
};
|
};
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Simple Variant
|
||||||
|
#[cfg(not(feature = "multicore"))]
|
||||||
|
{
|
||||||
|
let stats = SimpleStats::new(|s| println!("{}", s));
|
||||||
|
let mgr = SimpleEventManager::new(stats);
|
||||||
|
run_client(None, mgr, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user