@@ -204,6 +204,7 @@ fn test_apple(target: &str) {
204
204
"iconv.h" ,
205
205
"ifaddrs.h" ,
206
206
"langinfo.h" ,
207
+ "libgen.h" ,
207
208
"libproc.h" ,
208
209
"limits.h" ,
209
210
"locale.h" ,
@@ -417,6 +418,7 @@ fn test_openbsd(target: &str) {
417
418
"errno.h" ,
418
419
"execinfo.h" ,
419
420
"fcntl.h" ,
421
+ "libgen.h" ,
420
422
"limits.h" ,
421
423
"link.h" ,
422
424
"locale.h" ,
@@ -992,6 +994,7 @@ fn test_netbsd(target: &str) {
992
994
"elf.h" ,
993
995
"errno.h" ,
994
996
"fcntl.h" ,
997
+ "libgen.h" ,
995
998
"limits.h" ,
996
999
"link.h" ,
997
1000
"locale.h" ,
@@ -1206,6 +1209,7 @@ fn test_dragonflybsd(target: &str) {
1206
1209
"ifaddrs.h" ,
1207
1210
"kvm.h" ,
1208
1211
"langinfo.h" ,
1212
+ "libgen.h" ,
1209
1213
"limits.h" ,
1210
1214
"link.h" ,
1211
1215
"locale.h" ,
@@ -1505,6 +1509,7 @@ fn test_android(target: &str) {
1505
1509
"fcntl.h" ,
1506
1510
"grp.h" ,
1507
1511
"ifaddrs.h" ,
1512
+ "libgen.h" ,
1508
1513
"limits.h" ,
1509
1514
"link.h" ,
1510
1515
"locale.h" ,
@@ -1866,6 +1871,7 @@ fn test_freebsd(target: &str) {
1866
1871
"iconv.h" ,
1867
1872
"ifaddrs.h" ,
1868
1873
"langinfo.h" ,
1874
+ "libgen.h" ,
1869
1875
"libutil.h" ,
1870
1876
"limits.h" ,
1871
1877
"link.h" ,
@@ -2771,6 +2777,7 @@ fn test_linux(target: &str) {
2771
2777
"iconv.h" ,
2772
2778
"ifaddrs.h" ,
2773
2779
"langinfo.h" ,
2780
+ "libgen.h" ,
2774
2781
"limits.h" ,
2775
2782
"link.h" ,
2776
2783
"locale.h" ,
@@ -3410,6 +3417,22 @@ fn test_linux(target: &str) {
3410
3417
// it can't be changed from struct.
3411
3418
"pthread_sigqueue" => true ,
3412
3419
3420
+ // There are two versions of basename(3) on Linux with glibc, see
3421
+ //
3422
+ // https://man7.org/linux/man-pages/man3/basename.3.html
3423
+ //
3424
+ // If libgen.h is included, then the POSIX version will be available;
3425
+ // If _GNU_SOURCE is defined and string.h is included, then the GNU one
3426
+ // will be used.
3427
+ //
3428
+ // libc exposes both of them, providing a prefix to differentiate between
3429
+ // them.
3430
+ //
3431
+ // Because the name with prefix is not a valid symbol in C, we have to
3432
+ // skip the tests.
3433
+ "posix_basename" if gnu => true ,
3434
+ "gnu_basename" if gnu => true ,
3435
+
3413
3436
_ => false ,
3414
3437
}
3415
3438
} ) ;
0 commit comments