Skip to content

Commit f2ced93

Browse files
committed
Better document finding ioctl documentation
1 parent bf96510 commit f2ced93

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/sys/ioctl/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@
8585
//! `_IOC`, _IOR`, `_IOW`, and `_IORW` map to "none", "read", "write", and "readwrite"
8686
//! respectively.
8787
//!
88-
//! Some `ioctl`s can operate on arrays of objects, so there are `read buf`, `write buf`, and
89-
//! `readwrite buf` forms as well. These generate functions that include a `len` argument to
90-
//! specify the length of the array:
88+
//! More examples on using `ioctl!` can be found in the [rust-spidev crate](https://github.com/rust-embedded/rust-spidev).
9189
//!
9290
//! ```text
9391
//! pub unsafe fn $NAME(fd: c_int, val: *mut u8, len: usize) -> Result<c_int>;
@@ -128,13 +126,13 @@
128126
//!
129127
//! More examples on using `ioctl!` can be found in the [rust-spidev crate](https://github.com/rust-embedded/rust-spidev).
130128
//!
131-
//! How do I get the magic numbers?
132-
//! ===============================
129+
//! Finding ioctl documentation
130+
//! ---------------------------
133131
//!
134132
//! For Linux, look at your system's headers. For example, `/usr/include/linux/input.h` has a lot
135-
//! of lines defining macros which use `_IOR`, `_IOW`, `_IOC`, and `_IORW`. Finding documentation
136-
//! on some of those `ioctl`s can be trickier, however, though some are documented in the manpages
137-
//! and others are documented directly in the source.
133+
//! of lines defining macros which use `_IOR`, `_IOW`, `_IOC`, and `_IORW`. Some `ioctl`s are
134+
//! documented directly in the headers defining their constants, but others have more extensive
135+
//! documentation in man pages (like termios' `ioctl`s which are in `tty_ioctl(4)`).
138136
#[cfg(any(target_os = "linux", target_os = "android"))]
139137
#[path = "platform/linux.rs"]
140138
#[macro_use]

0 commit comments

Comments
 (0)