|
85 | 85 | //! `_IOC`, _IOR`, `_IOW`, and `_IORW` map to "none", "read", "write", and "readwrite"
|
86 | 86 | //! respectively.
|
87 | 87 | //!
|
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). |
91 | 89 | //!
|
92 | 90 | //! ```text
|
93 | 91 | //! pub unsafe fn $NAME(fd: c_int, val: *mut u8, len: usize) -> Result<c_int>;
|
|
128 | 126 | //!
|
129 | 127 | //! More examples on using `ioctl!` can be found in the [rust-spidev crate](https://github.com/rust-embedded/rust-spidev).
|
130 | 128 | //!
|
131 |
| -//! How do I get the magic numbers? |
132 |
| -//! =============================== |
| 129 | +//! Finding ioctl documentation |
| 130 | +//! --------------------------- |
133 | 131 | //!
|
134 | 132 | //! 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)`). |
138 | 136 | #[cfg(any(target_os = "linux", target_os = "android"))]
|
139 | 137 | #[path = "platform/linux.rs"]
|
140 | 138 | #[macro_use]
|
|
0 commit comments