File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed
Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " userfaultfd"
3- version = " 0.7 .0"
3+ version = " 0.8 .0"
44authors = [" The Wasmtime Project Developers" ]
55edition = " 2018"
66license = " MIT OR Apache-2.0"
Original file line number Diff line number Diff line change @@ -187,8 +187,7 @@ impl UffdBuilder {
187187 unsafe {
188188 raw:: api ( uffd. fd , & mut api as * mut raw:: uffdio_api ) ?;
189189 }
190- let supported =
191- IoctlFlags :: from_bits ( api. ioctls ) . ok_or ( Error :: UnrecognizedIoctls ( api. ioctls ) ) ?;
190+ let supported = IoctlFlags :: from_bits_retain ( api. ioctls ) ;
192191 if !supported. contains ( self . req_ioctls ) {
193192 Err ( Error :: UnsupportedIoctls ( supported) )
194193 } else {
Original file line number Diff line number Diff line change @@ -38,10 +38,6 @@ pub enum Error {
3838 #[ error( "Unrecognized event in uffd_msg: {0}" ) ]
3939 UnrecognizedEvent ( u8 ) ,
4040
41- /// An unrecognized ioctl bit was set in the result of API initialization or registration.
42- #[ error( "Unrecognized ioctl flags: {0}" ) ]
43- UnrecognizedIoctls ( u64 ) ,
44-
4541 /// Requested ioctls were not available when initializing the API.
4642 #[ error( "Requested ioctls unsupported; supported: {0:?}" ) ]
4743 UnsupportedIoctls ( IoctlFlags ) ,
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ impl Uffd {
118118 unsafe {
119119 raw:: register ( self . as_raw_fd ( ) , & mut register as * mut raw:: uffdio_register ) ?;
120120 }
121- IoctlFlags :: from_bits ( register . ioctls ) . ok_or ( Error :: UnrecognizedIoctls ( register. ioctls ) )
121+ Ok ( IoctlFlags :: from_bits_retain ( register. ioctls ) )
122122 }
123123
124124 /// Unregister a memory address range from the userfaultfd object.
@@ -377,6 +377,9 @@ bitflags! {
377377 #[ cfg( feature = "linux5_7" ) ]
378378 const WRITE_PROTECT = 1 << raw:: _UFFDIO_WRITEPROTECT;
379379 const API = 1 << raw:: _UFFDIO_API;
380+
381+ /// Unknown ioctls flags are allowed to be robust to future kernel changes.
382+ const _ = !0 ;
380383 }
381384}
382385
You can’t perform that action at this time.
0 commit comments