diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vtcol.rs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/vtcol.rs b/src/vtcol.rs index 707f96d..2c41d7b 100644 --- a/src/vtcol.rs +++ b/src/vtcol.rs @@ -265,19 +265,6 @@ impl<'a> Job } } /* [impl Job] */ -/* Rust appears to come with two wrappers for ``ioctl(2)``, but neither can be utilized for our - * purposes. The one in ``sys`` is part of a private (seriously‽) whereas the one in the - * ``libc`` module is defined as taking variable arguments and therefore cannot be called from - * Rust. Wrapping C is still a bit awkward, as it seems. - */ -extern "C" { - pub fn ioctl( - d: libc::c_int, - request: libc::c_int, - data: *mut libc::c_void, - ) -> libc::c_int; -} - const CONSOLE_PATHS: [&str; 6] = [ "/proc/self/fd/0", "/dev/tty", @@ -302,10 +289,10 @@ fn fd_of_path(path: &std::path::Path) -> Option<vtcol::Fd> let mut tty_type: libc::c_char = 0; let res = unsafe { - ioctl( + libc::ioctl( fd, - vtcol::KDGKBTYPE as libc::c_int, - std::mem::transmute(&mut tty_type), + vtcol::KDGKBTYPE, + &mut tty_type as *mut _ ) }; if res < 0 { |