Skip to content

Commit a367628

Browse files
authored
Merge pull request #3982 from tgross35/backport-basil
[0.2] Backports
2 parents 31f746a + 35f31f8 commit a367628

File tree

4 files changed

+66
-26
lines changed

4 files changed

+66
-26
lines changed

libc-test/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ fn test_apple(target: &str) {
205205
"errno.h",
206206
"execinfo.h",
207207
"fcntl.h",
208+
"fnmatch.h",
208209
"getopt.h",
209210
"glob.h",
210211
"grp.h",
@@ -482,6 +483,7 @@ fn test_openbsd(target: &str) {
482483
"errno.h",
483484
"execinfo.h",
484485
"fcntl.h",
486+
"fnmatch.h",
485487
"getopt.h",
486488
"libgen.h",
487489
"limits.h",
@@ -793,6 +795,7 @@ fn test_redox(target: &str) {
793795
"dlfcn.h",
794796
"errno.h",
795797
"fcntl.h",
798+
"fnmatch.h",
796799
"grp.h",
797800
"limits.h",
798801
"locale.h",
@@ -852,6 +855,7 @@ fn test_solarish(target: &str) {
852855
"errno.h",
853856
"execinfo.h",
854857
"fcntl.h",
858+
"fnmatch.h",
855859
"getopt.h",
856860
"glob.h",
857861
"grp.h",
@@ -1092,6 +1096,7 @@ fn test_netbsd(target: &str) {
10921096
"elf.h",
10931097
"errno.h",
10941098
"fcntl.h",
1099+
"fnmatch.h",
10951100
"getopt.h",
10961101
"libgen.h",
10971102
"limits.h",
@@ -1308,6 +1313,7 @@ fn test_dragonflybsd(target: &str) {
13081313
"errno.h",
13091314
"execinfo.h",
13101315
"fcntl.h",
1316+
"fnmatch.h",
13111317
"getopt.h",
13121318
"glob.h",
13131319
"grp.h",
@@ -1531,6 +1537,7 @@ fn test_wasi(target: &str) {
15311537
"dirent.h",
15321538
"errno.h",
15331539
"fcntl.h",
1540+
"fnmatch.h",
15341541
"langinfo.h",
15351542
"limits.h",
15361543
"locale.h",
@@ -1646,6 +1653,7 @@ fn test_android(target: &str) {
16461653
"elf.h",
16471654
"errno.h",
16481655
"fcntl.h",
1656+
"fnmatch.h",
16491657
"getopt.h",
16501658
"grp.h",
16511659
"ifaddrs.h",
@@ -2145,6 +2153,7 @@ fn test_freebsd(target: &str) {
21452153
"errno.h",
21462154
"execinfo.h",
21472155
"fcntl.h",
2156+
"fnmatch.h",
21482157
"getopt.h",
21492158
"glob.h",
21502159
"grp.h",
@@ -2762,6 +2771,7 @@ fn test_emscripten(target: &str) {
27622771
"dlfcn.h",
27632772
"errno.h",
27642773
"fcntl.h",
2774+
"fnmatch.h",
27652775
"glob.h",
27662776
"grp.h",
27672777
"ifaddrs.h",
@@ -3030,6 +3040,7 @@ fn test_neutrino(target: &str) {
30303040
"dlfcn.h",
30313041
"sys/elf.h",
30323042
"fcntl.h",
3043+
"fnmatch.h",
30333044
"glob.h",
30343045
"grp.h",
30353046
"iconv.h",
@@ -3427,6 +3438,7 @@ fn test_linux(target: &str) {
34273438
"dlfcn.h",
34283439
"elf.h",
34293440
"fcntl.h",
3441+
"fnmatch.h",
34303442
"getopt.h",
34313443
"glob.h",
34323444
[gnu]: "gnu/libc-version.h",

libc-test/semver/linux-musl.txt

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ AF_XDP
44
AIO_ALLDONE
55
AIO_CANCELED
66
AIO_NOTCANCELED
7-
MPOL_BIND
8-
MPOL_DEFAULT
9-
MPOL_INTERLEAVE
10-
MPOL_LOCAL
11-
MPOL_PREFERRED
127
BOOT_TIME
138
DEAD_PROCESS
9+
EMPTY
1410
Elf32_Chdr
1511
Elf64_Chdr
16-
EMPTY
1712
INIT_PROCESS
1813
LIO_NOP
1914
LIO_NOWAIT
2015
LIO_READ
2116
LIO_WAIT
2217
LIO_WRITE
2318
LOGIN_PROCESS
19+
MPOL_BIND
20+
MPOL_DEFAULT
21+
MPOL_INTERLEAVE
22+
MPOL_LOCAL
23+
MPOL_PREFERRED
2424
NEW_TIME
2525
OLD_TIME
2626
PF_IB
@@ -37,29 +37,29 @@ RWF_NOWAIT
3737
RWF_SYNC
3838
SOL_XDP
3939
USER_PROCESS
40-
XDP_SHARED_UMEM
4140
XDP_COPY
42-
XDP_ZEROCOPY
43-
XDP_USE_NEED_WAKEUP
44-
XDP_USE_SG
45-
XDP_UMEM_UNALIGNED_CHUNK_FLAG
46-
XDP_RING_NEED_WAKEUP
4741
XDP_MMAP_OFFSETS
48-
XDP_RX_RING
49-
XDP_TX_RING
50-
XDP_UMEM_REG
51-
XDP_UMEM_FILL_RING
52-
XDP_UMEM_COMPLETION_RING
53-
XDP_STATISTICS
5442
XDP_OPTIONS
5543
XDP_OPTIONS_ZEROCOPY
5644
XDP_PGOFF_RX_RING
5745
XDP_PGOFF_TX_RING
58-
XDP_UMEM_PGOFF_FILL_RING
46+
XDP_PKT_CONTD
47+
XDP_RING_NEED_WAKEUP
48+
XDP_RX_RING
49+
XDP_SHARED_UMEM
50+
XDP_STATISTICS
51+
XDP_TX_RING
52+
XDP_UMEM_COMPLETION_RING
53+
XDP_UMEM_FILL_RING
5954
XDP_UMEM_PGOFF_COMPLETION_RING
60-
XSK_UNALIGNED_BUF_OFFSET_SHIFT
55+
XDP_UMEM_PGOFF_FILL_RING
56+
XDP_UMEM_REG
57+
XDP_UMEM_UNALIGNED_CHUNK_FLAG
58+
XDP_USE_NEED_WAKEUP
59+
XDP_USE_SG
60+
XDP_ZEROCOPY
6161
XSK_UNALIGNED_BUF_ADDR_MASK
62-
XDP_PKT_CONTD
62+
XSK_UNALIGNED_BUF_OFFSET_SHIFT
6363
adjtimex
6464
aio_cancel
6565
aio_error
@@ -69,9 +69,14 @@ aio_return
6969
aio_suspend
7070
aio_write
7171
aiocb
72+
asctime_r
73+
basename
7274
clock_adjtime
7375
copy_file_range
7476
ctermid
77+
dirname
78+
eaccess
79+
euidaccess
7580
explicit_bzero
7681
futimes
7782
getauxval
@@ -92,8 +97,3 @@ pwritev64
9297
reallocarray
9398
tcp_info
9499
timex
95-
euidaccess
96-
eaccess
97-
asctime_r
98-
dirname
99-
basename

libc-test/semver/unix.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ FD_ZERO
132132
FILE
133133
FIOCLEX
134134
FIONBIO
135+
FNM_CASEFOLD
136+
FNM_NOESCAPE
137+
FNM_NOMATCH
138+
FNM_PATHNAME
139+
FNM_PERIOD
135140
F_DUPFD
136141
F_DUPFD_CLOEXEC
137142
F_GETFD
@@ -525,6 +530,7 @@ fgetpos
525530
fgets
526531
fileno
527532
flock
533+
fnmatch
528534
fopen
529535
fork
530536
fpathconf

src/unix/mod.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,24 @@ pub const ATF_PERM: ::c_int = 0x04;
313313
pub const ATF_PUBL: ::c_int = 0x08;
314314
pub const ATF_USETRAILERS: ::c_int = 0x10;
315315

316+
pub const FNM_PERIOD: c_int = 1 << 2;
317+
pub const FNM_CASEFOLD: c_int = 1 << 4;
318+
pub const FNM_NOMATCH: c_int = 1;
319+
320+
cfg_if! {
321+
if #[cfg(any(
322+
target_os = "macos",
323+
target_os = "freebsd",
324+
target_os = "android",
325+
))] {
326+
pub const FNM_PATHNAME: c_int = 1 << 1;
327+
pub const FNM_NOESCAPE: c_int = 1 << 0;
328+
} else {
329+
pub const FNM_PATHNAME: c_int = 1 << 0;
330+
pub const FNM_NOESCAPE: c_int = 1 << 1;
331+
}
332+
}
333+
316334
extern "C" {
317335
pub static in6addr_loopback: in6_addr;
318336
pub static in6addr_any: in6_addr;
@@ -1580,6 +1598,10 @@ cfg_if! {
15801598
}
15811599
}
15821600

1601+
extern "C" {
1602+
pub fn fnmatch(pattern: *const c_char, name: *const c_char, flags: c_int) -> c_int;
1603+
}
1604+
15831605
cfg_if! {
15841606
if #[cfg(target_env = "newlib")] {
15851607
mod newlib;

0 commit comments

Comments
 (0)