split out winsize from sys_ioctl header
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
include_guard = "_RELIBC_SYS_IOCTL_H"
|
||||
after_includes = """
|
||||
#include <bits/winsize.h> // for winsize from termios.h
|
||||
|
||||
// Shamelessly copy-pasted from musl
|
||||
|
||||
#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
|
||||
@@ -21,4 +23,4 @@ cpp_compat = true
|
||||
prefix_with_name = true
|
||||
|
||||
[export]
|
||||
include = ["sgttyb", "winsize"]
|
||||
include = ["sgttyb"]
|
||||
|
||||
@@ -12,21 +12,6 @@ pub struct sgttyb {
|
||||
sg_flags: c_ushort,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct winsize {
|
||||
ws_row: c_ushort,
|
||||
ws_col: c_ushort,
|
||||
ws_xpixel: c_ushort,
|
||||
ws_ypixel: c_ushort,
|
||||
}
|
||||
|
||||
impl winsize {
|
||||
pub fn get_row_col(&self) -> (c_ushort, c_ushort) {
|
||||
(self.ws_row, self.ws_col)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub use self::linux::*;
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@ use syscall;
|
||||
|
||||
use crate::{
|
||||
error::{Errno, Result, ResultExt},
|
||||
header::{errno::EINVAL, fcntl, termios},
|
||||
header::{bits_winsize::winsize, errno::EINVAL, fcntl, termios},
|
||||
platform::{
|
||||
Pal, Sys,
|
||||
types::{c_int, c_ulong, c_ulonglong, c_void, pid_t},
|
||||
},
|
||||
};
|
||||
|
||||
use super::winsize;
|
||||
|
||||
mod drm;
|
||||
|
||||
pub const TCGETS: c_ulong = 0x5401;
|
||||
|
||||
Reference in New Issue
Block a user