@@ -35,7 +35,7 @@ use crate::mem::shared_mem::ExclusiveSharedMemory;
3535use crate :: sandbox:: SandboxConfiguration ;
3636use crate :: { MultiUseSandbox , Result , new_error} ;
3737
38- #[ cfg( all ( target_os = "linux" , feature = " seccomp" ) ) ]
38+ #[ cfg( seccomp) ]
3939const EXTRA_ALLOWED_SYSCALLS_FOR_WRITER_FUNC : & [ super :: ExtraAllowedSyscall ] = & [
4040 // Fuzzing fails without `mmap` being an allowed syscall on our seccomp filter.
4141 // All fuzzing does is call `PrintOutput` (which calls `HostPrint` ). Thing is, `println!`
@@ -311,7 +311,7 @@ impl UninitializedSandbox {
311311 ///
312312 /// Unlike [`register`](Self::register), this variant allows specifying extra syscalls
313313 /// that will be permitted when the function handler runs.
314- #[ cfg( all ( feature = " seccomp" , target_os = "linux" ) ) ]
314+ #[ cfg( seccomp) ]
315315 pub fn register_with_extra_allowed_syscalls <
316316 Args : ParameterTuple ,
317317 Output : SupportedReturnType ,
@@ -334,10 +334,10 @@ impl UninitializedSandbox {
334334 & mut self ,
335335 print_func : impl Into < HostFunction < i32 , ( String , ) > > ,
336336 ) -> Result < ( ) > {
337- #[ cfg( not( all ( target_os = "linux" , feature = " seccomp" ) ) ) ]
337+ #[ cfg( not( seccomp) ) ]
338338 self . register ( "HostPrint" , print_func) ?;
339339
340- #[ cfg( all ( target_os = "linux" , feature = " seccomp" ) ) ]
340+ #[ cfg( seccomp) ]
341341 self . register_with_extra_allowed_syscalls (
342342 "HostPrint" ,
343343 print_func,
@@ -351,13 +351,13 @@ impl UninitializedSandbox {
351351 ///
352352 /// Like [`register_print`](Self::register_print), but allows specifying extra syscalls
353353 /// that will be permitted during function execution.
354- #[ cfg( all ( feature = " seccomp" , target_os = "linux" ) ) ]
354+ #[ cfg( seccomp) ]
355355 pub fn register_print_with_extra_allowed_syscalls (
356356 & mut self ,
357357 print_func : impl Into < HostFunction < i32 , ( String , ) > > ,
358358 extra_allowed_syscalls : impl IntoIterator < Item = crate :: sandbox:: ExtraAllowedSyscall > ,
359359 ) -> Result < ( ) > {
360- #[ cfg( all ( target_os = "linux" , feature = " seccomp" ) ) ]
360+ #[ cfg( seccomp) ]
361361 self . register_with_extra_allowed_syscalls (
362362 "HostPrint" ,
363363 print_func,
0 commit comments