@@ -2267,6 +2267,7 @@ fn test_linux(target: &str) {
2267
2267
let gnuabihf = target. contains ( "gnueabihf" ) ;
2268
2268
let x86_64_gnux32 = target. contains ( "gnux32" ) && x86_64;
2269
2269
let riscv64 = target. contains ( "riscv64" ) ;
2270
+ let uclibc = target. contains ( "uclibc" ) ;
2270
2271
2271
2272
let mut cfg = ctest_cfg ( ) ;
2272
2273
cfg. define ( "_GNU_SOURCE" , None ) ;
@@ -2377,7 +2378,8 @@ fn test_linux(target: &str) {
2377
2378
[ !( x32 || musl || gnu) ] : "sys/sysctl.h" ,
2378
2379
// <execinfo.h> is not supported by musl:
2379
2380
// https://www.openwall.com/lists/musl/2015/04/09/3
2380
- [ !musl] : "execinfo.h" ,
2381
+ // <execinfo.h> is not present on uclibc.
2382
+ [ !( musl || uclibc) ] : "execinfo.h" ,
2381
2383
}
2382
2384
2383
2385
// Include linux headers at the end:
@@ -2419,16 +2421,18 @@ fn test_linux(target: &str) {
2419
2421
"linux/sockios.h" ,
2420
2422
"linux/vm_sockets.h" ,
2421
2423
"linux/wait.h" ,
2422
- "sys/auxv.h" ,
2423
2424
"sys/fanotify.h" ,
2425
+ // <sys/auxv.h> is not present on uclibc
2426
+ [ !uclibc] : "sys/auxv.h" ,
2424
2427
}
2425
2428
2426
2429
// note: aio.h must be included before sys/mount.h
2427
2430
headers ! {
2428
2431
cfg:
2429
2432
"sys/xattr.h" ,
2430
2433
"sys/sysinfo.h" ,
2431
- "aio.h" ,
2434
+ // AIO is not supported by uclibc:
2435
+ [ !uclibc] : "aio.h" ,
2432
2436
}
2433
2437
2434
2438
cfg. type_name ( move |ty, is_struct, is_union| {
@@ -2650,6 +2654,8 @@ fn test_linux(target: &str) {
2650
2654
| "CAN_J1939"
2651
2655
| "CAN_RAW_FILTER_MAX"
2652
2656
| "CAN_NPROTO" => true ,
2657
+
2658
+ "MS_RMT_MASK" if uclibc => true , // updated in glibc 2.22 and musl 1.1.13
2653
2659
2654
2660
// FIXME: Requires recent kernel headers (5.8):
2655
2661
"STATX_MNT_ID" => true ,
@@ -2698,6 +2704,27 @@ fn test_linux(target: &str) {
2698
2704
// FIXME: It now takes c_void instead of timezone since glibc 2.31.
2699
2705
"gettimeofday" if gnu => true ,
2700
2706
2707
+ // These are all implemented as static inline functions in uclibc, so
2708
+ // they cannot be linked against.
2709
+ // If implementations are required, they might need to be implemented
2710
+ // in this crate.
2711
+ "posix_spawnattr_init" if uclibc => true ,
2712
+ "posix_spawnattr_destroy" if uclibc => true ,
2713
+ "posix_spawnattr_getsigdefault" if uclibc => true ,
2714
+ "posix_spawnattr_setsigdefault" if uclibc => true ,
2715
+ "posix_spawnattr_getsigmask" if uclibc => true ,
2716
+ "posix_spawnattr_setsigmask" if uclibc => true ,
2717
+ "posix_spawnattr_getflags" if uclibc => true ,
2718
+ "posix_spawnattr_setflags" if uclibc => true ,
2719
+ "posix_spawnattr_getpgroup" if uclibc => true ,
2720
+ "posix_spawnattr_setpgroup" if uclibc => true ,
2721
+ "posix_spawnattr_getschedpolicy" if uclibc => true ,
2722
+ "posix_spawnattr_setschedpolicy" if uclibc => true ,
2723
+ "posix_spawnattr_getschedparam" if uclibc => true ,
2724
+ "posix_spawnattr_setschedparam" if uclibc => true ,
2725
+ "posix_spawn_file_actions_init" if uclibc => true ,
2726
+ "posix_spawn_file_actions_destroy" if uclibc => true ,
2727
+
2701
2728
_ => false ,
2702
2729
}
2703
2730
} ) ;
0 commit comments