Skip to content

Commit e9b3be4

Browse files
committed
Add more documentation links, and fix some incorrect ones.
1 parent aea3459 commit e9b3be4

File tree

7 files changed

+98
-20
lines changed

7 files changed

+98
-20
lines changed

src/io/close.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,23 @@ use imp::fd::RawFd;
1313
/// Most users won't need to use this, as `OwnedFd` automatically closes its
1414
/// file descriptor on `Drop`.
1515
///
16-
/// This function does not return a `Result`, as it is the [responsibility]
17-
/// of filesystem designers to not return errors from `close`. Users who chose
18-
/// to use NFS or similar filesystems should take care to monitor for problems
16+
/// This function does not return a `Result`, as it is the [responsibility] of
17+
/// filesystem designers to not return errors from `close`. Users who chose to
18+
/// use NFS or similar filesystems should take care to monitor for problems
1919
/// externally.
2020
///
2121
/// [responsibility]: https://lwn.net/Articles/576518/
2222
///
2323
/// # References
24-
///
2524
/// - [POSIX]
2625
/// - [Linux]
2726
/// - [Apple]
27+
/// - [Winsock2]
2828
///
2929
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html
3030
/// [Linux]: https://man7.org/linux/man-pages/man2/close.2.html
3131
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/close.2.html#//apple_ref/doc/man/2/close
32+
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-closesocket
3233
///
3334
/// # Safety
3435
///

src/io/dup.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ pub use imp::io::types::DupFlags;
2020
/// # References
2121
/// - [POSIX]
2222
/// - [Linux]
23+
/// - [Apple]
2324
///
2425
/// [file description]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_258
2526
/// [`fcntl_dupfd_cloexec`]: crate::fs::fcntl_dupfd_cloexec
2627
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html
2728
/// [Linux]: https://man7.org/linux/man-pages/man2/dup.2.html
29+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/dup.2.html
2830
#[cfg(not(target_os = "wasi"))]
2931
#[inline]
3032
pub fn dup<Fd: AsFd>(fd: Fd) -> io::Result<OwnedFd> {
@@ -45,11 +47,13 @@ pub fn dup<Fd: AsFd>(fd: Fd) -> io::Result<OwnedFd> {
4547
/// # References
4648
/// - [POSIX]
4749
/// - [Linux]
50+
/// - [Apple]
4851
///
4952
/// [file description]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_258
53+
/// [`fcntl_dupfd_cloexec`]: crate::fs::fcntl_dupfd_cloexec
5054
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html
5155
/// [Linux]: https://man7.org/linux/man-pages/man2/dup2.2.html
52-
/// [`fcntl_dupfd_cloexec`]: crate::fs::fcntl_dupfd_cloexec
56+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/dup2.2.html
5357
#[cfg(not(target_os = "wasi"))]
5458
#[inline]
5559
pub fn dup2<Fd: AsFd>(fd: Fd, new: &mut OwnedFd) -> io::Result<()> {
@@ -59,18 +63,16 @@ pub fn dup2<Fd: AsFd>(fd: Fd, new: &mut OwnedFd) -> io::Result<()> {
5963
/// `dup3(fd, new, flags)`—Changes the [file description] of a file
6064
/// descriptor, with flags.
6165
///
62-
/// `dup3` is the same as [`dup2`] but adds an additional flags operand,
63-
/// and it fails in the case that `fd` and `new` have the same file descriptor
64-
/// value. This additional difference is the reason this function isn't named
66+
/// `dup3` is the same as [`dup2`] but adds an additional flags operand, and it
67+
/// fails in the case that `fd` and `new` have the same file descriptor value.
68+
/// This additional difference is the reason this function isn't named
6569
/// `dup2_with`.
6670
///
6771
/// # References
68-
/// - [POSIX]
6972
/// - [Linux]
7073
///
7174
/// [file description]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_258
72-
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html
73-
/// [Linux]: https://man7.org/linux/man-pages/man2/dup2.2.html
75+
/// [Linux]: https://man7.org/linux/man-pages/man2/dup3.2.html
7476
#[cfg(not(target_os = "wasi"))]
7577
#[inline]
7678
pub fn dup3<Fd: AsFd>(fd: Fd, new: &mut OwnedFd, flags: DupFlags) -> io::Result<()> {

src/io/ioctl.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ pub fn ioctl_tiocnxcl<Fd: AsFd>(fd: Fd) -> io::Result<()> {
3535
/// `ioctl(fd, FIOCLEX)`—Set the close-on-exec flag.
3636
///
3737
/// Also known as `fcntl(fd, F_SETFD, FD_CLOEXEC)`.
38+
///
39+
/// # References
40+
/// - [Linux]
41+
/// - [Winsock2]
42+
///
43+
/// [Linux]: https://man7.org/linux/man-pages/man2/ioctl.2.html
44+
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-ioctlsocket
3845
#[cfg(any(target_os = "ios", target_os = "macos"))]
3946
#[inline]
4047
#[doc(alias = "FIOCLEX")]
@@ -44,6 +51,13 @@ pub fn ioctl_fioclex<Fd: AsFd>(fd: Fd) -> io::Result<()> {
4451
}
4552

4653
/// `ioctl(fd, FIONBIO, &value)`—Enables or disables non-blocking mode.
54+
///
55+
/// # References
56+
/// - [Linux]
57+
/// - [Winsock2]
58+
///
59+
/// [Linux]: https://man7.org/linux/man-pages/man2/ioctl.2.html
60+
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-ioctlsocket
4761
#[inline]
4862
#[doc(alias = "FIONBIO")]
4963
pub fn ioctl_fionbio<Fd: AsFd>(fd: Fd, value: bool) -> io::Result<()> {

src/io/pipe.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub use imp::io::types::PipeFlags;
77
/// `PIPE_BUF`—The maximum length at which writes to a pipe are atomic.
88
///
99
/// # References
10-
///
1110
/// - [Linux]
1211
/// - [POSIX]
1312
///

src/io/poll.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ pub use imp::io::poll_fd::{PollFd, PollFlags};
77
/// # References
88
/// - [POSIX]
99
/// - [Linux]
10+
/// - [Apple]
11+
/// - [Winsock2]
1012
///
1113
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html
1214
/// [Linux]: https://man7.org/linux/man-pages/man2/poll.2.html
15+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/poll.2.html
16+
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll
1317
#[inline]
1418
pub fn poll(fds: &mut [PollFd<'_>], timeout: i32) -> io::Result<usize> {
1519
imp::io::syscalls::poll(fds, timeout)

src/net/send_recv.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ pub use imp::net::send_recv::{RecvFlags, SendFlags};
1313
/// # References
1414
/// - [POSIX]
1515
/// - [Linux]
16+
/// - [Apple]
1617
/// - [Winsock2]
1718
///
1819
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html
1920
/// [Linux]: https://man7.org/linux/man-pages/man2/recv.2.html
21+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recv.2.html
2022
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv
2123
#[inline]
2224
pub fn recv<Fd: AsFd>(fd: Fd, buf: &mut [u8], flags: RecvFlags) -> io::Result<usize> {
@@ -28,10 +30,12 @@ pub fn recv<Fd: AsFd>(fd: Fd, buf: &mut [u8], flags: RecvFlags) -> io::Result<us
2830
/// # References
2931
/// - [POSIX]
3032
/// - [Linux]
33+
/// - [Apple]
3134
/// - [Winsock2]
3235
///
3336
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html
3437
/// [Linux]: https://man7.org/linux/man-pages/man2/send.2.html
38+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/send.2.html
3539
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-send
3640
#[inline]
3741
pub fn send<Fd: AsFd>(fd: Fd, buf: &[u8], flags: SendFlags) -> io::Result<usize> {
@@ -44,10 +48,12 @@ pub fn send<Fd: AsFd>(fd: Fd, buf: &[u8], flags: SendFlags) -> io::Result<usize>
4448
/// # References
4549
/// - [POSIX]
4650
/// - [Linux]
51+
/// - [Apple]
4752
/// - [Winsock2]
4853
///
4954
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html
5055
/// [Linux]: https://man7.org/linux/man-pages/man2/recvfrom.2.html
56+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/recvfrom.2.html
5157
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recvfrom
5258
#[inline]
5359
pub fn recvfrom<Fd: AsFd>(
@@ -64,9 +70,13 @@ pub fn recvfrom<Fd: AsFd>(
6470
/// # References
6571
/// - [POSIX]
6672
/// - [Linux]
73+
/// - [Apple]
74+
/// - [Winsock2]
6775
///
6876
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
6977
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
78+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
79+
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
7080
pub fn sendto<Fd: AsFd>(
7181
fd: Fd,
7282
buf: &[u8],
@@ -94,9 +104,13 @@ fn _sendto(
94104
/// # References
95105
/// - [POSIX]
96106
/// - [Linux]
107+
/// - [Apple]
108+
/// - [Winsock2]
97109
///
98110
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
99111
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
112+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
113+
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
100114
pub fn sendto_any<Fd: AsFd>(
101115
fd: Fd,
102116
buf: &[u8],
@@ -126,10 +140,12 @@ fn _sendto_any(
126140
/// # References
127141
/// - [POSIX]
128142
/// - [Linux]
143+
/// - [Apple]
129144
/// - [Winsock2]
130145
///
131146
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
132147
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
148+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
133149
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
134150
#[inline]
135151
#[doc(alias = "sendto")]
@@ -148,10 +164,12 @@ pub fn sendto_v4<Fd: AsFd>(
148164
/// # References
149165
/// - [POSIX]
150166
/// - [Linux]
167+
/// - [Apple]
151168
/// - [Winsock2]
152169
///
153170
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
154171
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
172+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
155173
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
156174
#[inline]
157175
#[doc(alias = "sendto")]
@@ -170,10 +188,12 @@ pub fn sendto_v6<Fd: AsFd>(
170188
/// # References
171189
/// - [POSIX]
172190
/// - [Linux]
191+
/// - [Apple]
173192
/// - [Winsock2]
174193
///
175194
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html
176195
/// [Linux]: https://man7.org/linux/man-pages/man2/sendto.2.html
196+
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sendto.2.html
177197
/// [Winsock2]: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-sendto
178198
#[cfg(unix)]
179199
#[inline]

0 commit comments

Comments
 (0)