@@ -36,7 +36,7 @@ use crate::mem::shared_mem::ExclusiveSharedMemory;
3636use crate :: sandbox:: SandboxConfiguration ;
3737use crate :: { MultiUseSandbox , Result , new_error} ;
3838
39- #[ cfg( all ( target_os = "linux" , feature = " seccomp" ) ) ]
39+ #[ cfg( seccomp) ]
4040const EXTRA_ALLOWED_SYSCALLS_FOR_WRITER_FUNC : & [ super :: ExtraAllowedSyscall ] = & [
4141 // Fuzzing fails without `mmap` being an allowed syscall on our seccomp filter.
4242 // All fuzzing does is call `PrintOutput` (which calls `HostPrint` ). Thing is, `println!`
@@ -325,7 +325,7 @@ impl UninitializedSandbox {
325325 ///
326326 /// Unlike [`register`](Self::register), this variant allows specifying extra syscalls
327327 /// that will be permitted when the function handler runs.
328- #[ cfg( all ( feature = " seccomp" , target_os = "linux" ) ) ]
328+ #[ cfg( seccomp) ]
329329 pub fn register_with_extra_allowed_syscalls <
330330 Args : ParameterTuple ,
331331 Output : SupportedReturnType ,
@@ -348,10 +348,10 @@ impl UninitializedSandbox {
348348 & mut self ,
349349 print_func : impl Into < HostFunction < i32 , ( String , ) > > ,
350350 ) -> Result < ( ) > {
351- #[ cfg( not( all ( target_os = "linux" , feature = " seccomp" ) ) ) ]
351+ #[ cfg( not( seccomp) ) ]
352352 self . register ( "HostPrint" , print_func) ?;
353353
354- #[ cfg( all ( target_os = "linux" , feature = " seccomp" ) ) ]
354+ #[ cfg( seccomp) ]
355355 self . register_with_extra_allowed_syscalls (
356356 "HostPrint" ,
357357 print_func,
@@ -365,13 +365,13 @@ impl UninitializedSandbox {
365365 ///
366366 /// Like [`register_print`](Self::register_print), but allows specifying extra syscalls
367367 /// that will be permitted during function execution.
368- #[ cfg( all ( feature = " seccomp" , target_os = "linux" ) ) ]
368+ #[ cfg( seccomp) ]
369369 pub fn register_print_with_extra_allowed_syscalls (
370370 & mut self ,
371371 print_func : impl Into < HostFunction < i32 , ( String , ) > > ,
372372 extra_allowed_syscalls : impl IntoIterator < Item = crate :: sandbox:: ExtraAllowedSyscall > ,
373373 ) -> Result < ( ) > {
374- #[ cfg( all ( target_os = "linux" , feature = " seccomp" ) ) ]
374+ #[ cfg( seccomp) ]
375375 self . register_with_extra_allowed_syscalls (
376376 "HostPrint" ,
377377 print_func,
0 commit comments