@@ -2740,6 +2740,9 @@ fn test_linux(target: &str) {
27402740 | "Elf64_Shdr" | "Elf32_Sym" | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr"
27412741 | "Elf32_Chdr" | "Elf64_Chdr" => ty. to_string ( ) ,
27422742
2743+ "Ioctl" if gnu => "unsigned long" . to_string ( ) ,
2744+ "Ioctl" => "int" . to_string ( ) ,
2745+
27432746 t if is_union => format ! ( "union {}" , t) ,
27442747
27452748 t if t. ends_with ( "_t" ) => t. to_string ( ) ,
@@ -2797,6 +2800,9 @@ fn test_linux(target: &str) {
27972800 // on Linux, this is a volatile int
27982801 "pthread_spinlock_t" => true ,
27992802
2803+ // For internal use only, to define architecture specific ioctl constants with a libc specific type.
2804+ "Ioctl" => true ,
2805+
28002806 _ => false ,
28012807 }
28022808 } ) ;
@@ -3227,6 +3233,7 @@ fn test_linux(target: &str) {
32273233// This function tests APIs that are incompatible to test when other APIs
32283234// are included (e.g. because including both sets of headers clashes)
32293235fn test_linux_like_apis ( target : & str ) {
3236+ let gnu = target. contains ( "gnu" ) ;
32303237 let musl = target. contains ( "musl" ) ;
32313238 let linux = target. contains ( "linux" ) ;
32323239 let emscripten = target. contains ( "emscripten" ) ;
@@ -3293,6 +3300,8 @@ fn test_linux_like_apis(target: &str) {
32933300 } )
32943301 . skip_struct ( |s| s != "termios2" )
32953302 . type_name ( move |ty, is_struct, is_union| match ty {
3303+ "Ioctl" if gnu => "unsigned long" . to_string ( ) ,
3304+ "Ioctl" => "int" . to_string ( ) ,
32963305 t if is_struct => format ! ( "struct {}" , t) ,
32973306 t if is_union => format ! ( "union {}" , t) ,
32983307 t => t. to_string ( ) ,
0 commit comments