diff options
author | Carl Lerche <me@carllerche.com> | 2015-05-28 15:46:53 -0700 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-05-28 15:46:53 -0700 |
commit | e2b08fad9c3334e2791aebc28fa1d71d0f76112b (patch) | |
tree | 6b1690264570ff9b21cc0d23b7b6251475365376 /src/sys/ioctl.rs | |
parent | 663091bb2873fa45663b746bccefc85f223d13d6 (diff) | |
download | nix-e2b08fad9c3334e2791aebc28fa1d71d0f76112b.zip |
Remove std::os::unix::io::RawFd re-export
Diffstat (limited to 'src/sys/ioctl.rs')
-rw-r--r-- | src/sys/ioctl.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/sys/ioctl.rs b/src/sys/ioctl.rs index 6904ce56..d295d08d 100644 --- a/src/sys/ioctl.rs +++ b/src/sys/ioctl.rs @@ -70,11 +70,11 @@ //! necessary for cases (notably slices) where a reference cannot //! be generically cast to a pointer. +use {Error, Result, errno}; use libc::{c_int, c_ulong}; use libc::funcs::bsd44::ioctl as libc_ioctl; use std::mem; -use fcntl::Fd; -use {Error, Result, errno}; +use std::os::unix::io::RawFd; pub type ioctl_op_t = c_ulong; @@ -177,7 +177,7 @@ fn convert_ioctl_res(res: c_int) -> Result<c_int> { /// /// This function will allocate allocate space for and returned an owned /// reference to the result. -pub unsafe fn read<T>(fd: Fd, op: ioctl_op_t) -> Result<T> { +pub unsafe fn read<T>(fd: RawFd, op: ioctl_op_t) -> Result<T> { // allocate memory for the result (should get a value from kernel) let mut dst: T = mem::zeroed(); let dst_ptr: *mut T = &mut dst; @@ -190,7 +190,7 @@ pub unsafe fn read<T>(fd: Fd, op: ioctl_op_t) -> Result<T> { /// /// The refernced data may also contain information that will be consumed /// by the kernel. -pub unsafe fn read_into<T>(fd: Fd, op: ioctl_op_t, data: &mut T) -> Result<c_int> { +pub unsafe fn read_into<T>(fd: RawFd, op: ioctl_op_t, data: &mut T) -> Result<c_int> { read_into_ptr(fd, op, data as *mut T) } @@ -199,25 +199,25 @@ pub unsafe fn read_into<T>(fd: Fd, op: ioctl_op_t, data: &mut T) -> Result<c_int /// /// The refernced data may also contain information that will be consumed /// by the kernel. -pub unsafe fn read_into_ptr<T>(fd: Fd, op: ioctl_op_t, data_ptr: *mut T) -> Result<c_int> { +pub unsafe fn read_into_ptr<T>(fd: RawFd, op: ioctl_op_t, data_ptr: *mut T) -> Result<c_int> { convert_ioctl_res(libc_ioctl(fd, op as os_ioctl_op_t, data_ptr)) } /// Ioctl call that sends a value to the kernel but /// does not return anything (pure side effect). -pub unsafe fn write<T>(fd: Fd, op: ioctl_op_t, data: &T) -> Result<c_int> { +pub unsafe fn write<T>(fd: RawFd, op: ioctl_op_t, data: &T) -> Result<c_int> { write_ptr(fd, op, data as *const T) } /// Ioctl call that sends a value to the kernel but /// does not return anything (pure side effect). -pub unsafe fn write_ptr<T>(fd: Fd, op: ioctl_op_t, data: *const T) -> Result<c_int> { +pub unsafe fn write_ptr<T>(fd: RawFd, op: ioctl_op_t, data: *const T) -> Result<c_int> { convert_ioctl_res(libc_ioctl(fd, op as os_ioctl_op_t, data as *const T)) } /// Ioctl call for which no data pointer is provided to the kernel. /// That is, the kernel has sufficient information about what to /// do based on the op alone. -pub fn execute(fd: Fd, op: ioctl_op_t) -> Result<c_int> { +pub fn execute(fd: RawFd, op: ioctl_op_t) -> Result<c_int> { convert_ioctl_res(unsafe { libc_ioctl(fd, op as os_ioctl_op_t) }) } |