Commit 8e1fa43
authored
Use rustix instead of direct calls to libc. (#76)
* Use rustix instead of direct calls to libc.
Use the [rustix] syscall wrapper crate to factor out error handling and
unsafe system calls. This reduces the amount of unsafe code here, and is
a step towards factoring it out entirely once [`AsFd`] is stabilized and
can replace `AsRawFd` for these kinds of uses.
This does require incrementing the minimum required Rust version to 1.48.
Please feel free to decline this PR if you don't wish to take on these new
requirements.
[rustix]: https://crates.io/crates/rustix/
[`AsFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/trait.AsFd.html
* Disable the use-libc-auxv feature.
* Use rustix to call `FIONBIO` on Windows.
This eliminates the need for a direct dependency on windows-sys.
* Comment that we need Rust >= 1.63 to use io_safety.1 parent 233b5ba commit 8e1fa43
File tree
4 files changed
+28
-30
lines changed- .github/workflows
- examples
- src
4 files changed
+28
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 36 | | |
42 | 37 | | |
43 | 38 | | |
| |||
49 | 44 | | |
50 | 45 | | |
51 | 46 | | |
52 | | - | |
53 | 47 | | |
54 | 48 | | |
55 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
613 | 611 | | |
614 | 612 | | |
615 | | - | |
| 613 | + | |
616 | 614 | | |
617 | 615 | | |
618 | 616 | | |
| |||
678 | 676 | | |
679 | 677 | | |
680 | 678 | | |
| 679 | + | |
681 | 680 | | |
682 | 681 | | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
691 | 687 | | |
692 | 688 | | |
693 | 689 | | |
| |||
1895 | 1891 | | |
1896 | 1892 | | |
1897 | 1893 | | |
1898 | | - | |
| 1894 | + | |
1899 | 1895 | | |
1900 | 1896 | | |
1901 | 1897 | | |
| |||
0 commit comments