@@ -15,8 +15,6 @@ limitations under the License.
1515*/
1616
1717use hyperlight_host:: func:: { HostFunction , ParameterTuple , Registerable , SupportedReturnType } ;
18- #[ cfg( all( feature = "seccomp" , target_os = "linux" ) ) ]
19- use hyperlight_host:: sandbox:: ExtraAllowedSyscall ;
2018use hyperlight_host:: sandbox:: config:: SandboxConfiguration ;
2119use hyperlight_host:: { GuestBinary , Result , UninitializedSandbox , new_error} ;
2220
@@ -46,18 +44,6 @@ impl Registerable for ProtoWasmSandbox {
4644 . ok_or ( new_error ! ( "inner sandbox was none" ) )
4745 . and_then ( |sb| sb. register ( name, hf) )
4846 }
49- #[ cfg( all( feature = "seccomp" , target_os = "linux" ) ) ]
50- fn register_host_function_with_syscalls < Args : ParameterTuple , Output : SupportedReturnType > (
51- & mut self ,
52- name : & str ,
53- hf : impl Into < HostFunction < Output , Args > > ,
54- eas : Vec < ExtraAllowedSyscall > ,
55- ) -> Result < ( ) > {
56- self . inner
57- . as_mut ( )
58- . ok_or ( new_error ! ( "inner sandbox was none" ) )
59- . and_then ( |sb| sb. register_host_function_with_syscalls ( name, hf, eas) )
60- }
6147}
6248
6349impl ProtoWasmSandbox {
@@ -119,25 +105,6 @@ impl ProtoWasmSandbox {
119105 . register ( name, host_func)
120106 }
121107
122- /// Register the given host function `host_func` with `self` along with a vec of syscalls the
123- /// function requires and return `Ok` if the registration succeeded, and a descriptive `Err` if
124- /// it didn't.
125- #[ cfg( all( feature = "seccomp" , target_os = "linux" ) ) ]
126- pub fn register_with_extra_allowed_syscalls <
127- Args : ParameterTuple ,
128- Output : SupportedReturnType ,
129- > (
130- & mut self ,
131- name : impl AsRef < str > ,
132- host_func : impl Into < HostFunction < Output , Args > > ,
133- extra_allowed_syscalls : impl IntoIterator < Item = ExtraAllowedSyscall > ,
134- ) -> Result < ( ) > {
135- self . inner
136- . as_mut ( )
137- . ok_or ( new_error ! ( "inner sandbox was none" ) ) ?
138- . register_with_extra_allowed_syscalls ( name, host_func, extra_allowed_syscalls)
139- }
140-
141108 /// Register the given host printing function `print_func` with `self`.
142109 /// Return `Ok` if the registration succeeded, and a descriptive `Err` otherwise.
143110 pub fn register_print (
@@ -149,21 +116,6 @@ impl ProtoWasmSandbox {
149116 . ok_or ( new_error ! ( "inner sandbox was none" ) ) ?
150117 . register_print ( print_func)
151118 }
152-
153- /// Register the given host printing function `print_func` with `self` along with a
154- /// vec of syscalls the function requires.
155- /// Return `Ok` if the registration succeeded, and a descriptive `Err` otherwise.
156- #[ cfg( all( feature = "seccomp" , target_os = "linux" ) ) ]
157- pub fn register_print_with_extra_allowed_syscalls (
158- & mut self ,
159- print_func : impl Into < HostFunction < i32 , ( String , ) > > ,
160- extra_allowed_syscalls : impl IntoIterator < Item = ExtraAllowedSyscall > ,
161- ) -> Result < ( ) > {
162- self . inner
163- . as_mut ( )
164- . ok_or ( new_error ! ( "inner sandbox was none" ) ) ?
165- . register_print_with_extra_allowed_syscalls ( print_func, extra_allowed_syscalls)
166- }
167119}
168120
169121impl std:: fmt:: Debug for ProtoWasmSandbox {
0 commit comments