(fd: Fd, mut buf: Buf)
| 37 | /// [glibc]: https://sourceware.org/glibc/manual/latest/html_node/I_002fO-Primitives.html#index-reading-from-a-file-descriptor |
| 38 | #[inline] |
| 39 | pub fn read<Fd: AsFd, Buf: Buffer<u8>>(fd: Fd, mut buf: Buf) -> io::Result<Buf::Output> { |
| 40 | // SAFETY: `read` behaves. |
| 41 | let len = unsafe { backend::io::syscalls::read(fd.as_fd(), buf.parts_mut())? }; |
| 42 | // SAFETY: `read` behaves. |
| 43 | unsafe { Ok(buf.assume_init(len)) } |
| 44 | } |
| 45 | |
| 46 | /// `write(fd, buf)`—Writes to a stream. |
| 47 | /// |
nothing calls this directly
no test coverage detected