summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-10-17 22:32:28 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-10-17 22:32:28 +0000
commitcfbfa1287dc80147b48205fbd2c18903781745e5 (patch)
tree2418fe3f323bbe2aaec486f4d7fb06345c992ab2
parenta063625c766e84dd5ef510935f50264b6c986abf (diff)
parentdc41be48a7d0eca700205d9fa585690305ad26d5 (diff)
downloadnix-cfbfa1287dc80147b48205fbd2c18903781745e5.zip
Merge #940
940: Document ioctl_param_type r=asomers a=rukai Currently the docs claim ioctl_param_type to always be libc::c_int which is not the case on linux. Also removes an unused import that was triggering a warning. Co-authored-by: Rukai <rubickent@gmail.com>
-rw-r--r--src/sys/ioctl/mod.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/sys/ioctl/mod.rs b/src/sys/ioctl/mod.rs
index e00e5934..35d508b1 100644
--- a/src/sys/ioctl/mod.rs
+++ b/src/sys/ioctl/mod.rs
@@ -221,7 +221,6 @@
//!
//! # fn main() {}
//! ```
-//!
#[cfg(any(target_os = "android", target_os = "linux"))]
#[macro_use]
mod linux;
@@ -502,9 +501,13 @@ cfg_if!{
/// The generated function has the following signature:
///
/// ```rust,ignore
- /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: libc::c_int) -> Result<libc::c_int>
+ /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result<libc::c_int>
/// ```
///
+ /// `nix::sys::ioctl::ioctl_param_type` depends on the OS:
+ /// * BSD - `libc::c_int`
+ /// * Linux - `libc::c_ulong`
+ ///
/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html).
///
/// # Example
@@ -537,9 +540,13 @@ cfg_if!{
/// The generated function has the following signature:
///
/// ```rust,ignore
- /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: libc::c_int) -> Result<libc::c_int>
+ /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result<libc::c_int>
/// ```
///
+ /// `nix::sys::ioctl::ioctl_param_type` depends on the OS:
+ /// * BSD - `libc::c_int`
+ /// * Linux - `libc::c_ulong`
+ ///
/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html).
///
/// # Example
@@ -655,7 +662,7 @@ macro_rules! ioctl_readwrite {
///
/// The generated function has the following signature:
///
-/// ```rust,ignorerust,ignore
+/// ```rust,ignore
/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result<libc::c_int>
/// ```
///