Commit efcc300
authored
Rollup merge of rust-lang#92778 - tavianator:linux-readdir-no-r, r=joshtriplett
fs: Use readdir() instead of readdir_r() on Linux
readdir() is preferred over readdir_r() on Linux and many other
platforms because it more gracefully supports long file names. Both
glibc and musl (and presumably all other Linux libc implementations)
guarantee that readdir() is thread-safe as long as a single DIR* is not
accessed concurrently, which is enough to make a readdir()-based
implementation of ReadDir safe. This implementation is already used for
some other OSes including Fuchsia, Redox, and Solaris.
See rust-lang#40021 for more details. Fixes rust-lang#86649.2 files changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| |||
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
| 212 | + | |
205 | 213 | | |
206 | 214 | | |
207 | 215 | | |
| |||
223 | 231 | | |
224 | 232 | | |
225 | 233 | | |
| 234 | + | |
226 | 235 | | |
227 | 236 | | |
228 | 237 | | |
| |||
449 | 458 | | |
450 | 459 | | |
451 | 460 | | |
| 461 | + | |
452 | 462 | | |
453 | 463 | | |
454 | 464 | | |
| |||
464 | 474 | | |
465 | 475 | | |
466 | 476 | | |
467 | | - | |
| 477 | + | |
468 | 478 | | |
469 | 479 | | |
470 | 480 | | |
| |||
492 | 502 | | |
493 | 503 | | |
494 | 504 | | |
| 505 | + | |
495 | 506 | | |
496 | 507 | | |
497 | 508 | | |
| |||
647 | 658 | | |
648 | 659 | | |
649 | 660 | | |
650 | | - | |
651 | 661 | | |
652 | 662 | | |
653 | 663 | | |
| |||
658 | 668 | | |
659 | 669 | | |
660 | 670 | | |
| 671 | + | |
661 | 672 | | |
662 | 673 | | |
663 | 674 | | |
| |||
1068 | 1079 | | |
1069 | 1080 | | |
1070 | 1081 | | |
| 1082 | + | |
1071 | 1083 | | |
1072 | 1084 | | |
1073 | 1085 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments