File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -459,6 +459,11 @@ fn main() {
459
459
// asm/termios.h and ioctl.h (+ some other headers) because of redeclared types.
460
460
"CMSPAR" if mips && linux && !musl => true ,
461
461
462
+ // These constants are tested in a separate test program generated below because there
463
+ // are header conflicts if we try to include the headers that define them here.
464
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => true ,
465
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => true ,
466
+
462
467
_ => false ,
463
468
}
464
469
} ) ;
@@ -635,4 +640,23 @@ fn main() {
635
640
} else {
636
641
cfg. generate ( "../src/lib.rs" , "all.rs" ) ;
637
642
}
643
+
644
+ // On Linux or Android also generate another script for testing linux/fcntl declarations.
645
+ // These cannot be tested normally because including both `linux/fcntl.h` and `fcntl.h`
646
+ // fails on a lot of platforms.
647
+ if android || linux {
648
+ let mut cfg = ctest:: TestGenerator :: new ( ) ;
649
+ cfg. header ( "linux/fcntl.h" ) ;
650
+ cfg. skip_type ( |_| true )
651
+ . skip_struct ( |_| true )
652
+ . skip_fn ( |_| true ) ;
653
+ cfg. skip_const ( move |name| {
654
+ match name {
655
+ "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false ,
656
+ "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => false ,
657
+ _ => true ,
658
+ }
659
+ } ) ;
660
+ cfg. generate ( "../src/lib.rs" , "linux_fcntl.rs" ) ;
661
+ }
638
662
}
Original file line number Diff line number Diff line change @@ -212,9 +212,17 @@ pub const F_SETFL: ::c_int = 4;
212
212
pub const F_SETLEASE : :: c_int = 1024 ;
213
213
pub const F_GETLEASE : :: c_int = 1025 ;
214
214
pub const F_NOTIFY : :: c_int = 1026 ;
215
+ pub const F_CANCELLK : :: c_int = 1029 ;
215
216
pub const F_DUPFD_CLOEXEC : :: c_int = 1030 ;
216
217
pub const F_SETPIPE_SZ : :: c_int = 1031 ;
217
218
pub const F_GETPIPE_SZ : :: c_int = 1032 ;
219
+ pub const F_ADD_SEALS : :: c_int = 1033 ;
220
+ pub const F_GET_SEALS : :: c_int = 1034 ;
221
+
222
+ pub const F_SEAL_SEAL : :: c_int = 0x0001 ;
223
+ pub const F_SEAL_SHRINK : :: c_int = 0x0002 ;
224
+ pub const F_SEAL_GROW : :: c_int = 0x0004 ;
225
+ pub const F_SEAL_WRITE : :: c_int = 0x0008 ;
218
226
219
227
// TODO(#235): Include file sealing fcntls once we have a way to verify them.
220
228
You can’t perform that action at this time.
0 commit comments