mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 00:35:10 +00:00
Replace syscall3 to os.ioctl
This commit is contained in:
parent
09c01ea7b9
commit
7c71054286
@ -2391,7 +2391,7 @@ pub fn isatty(handle: fd_t) bool {
|
||||
}
|
||||
if (builtin.os.tag == .linux) {
|
||||
var wsz: linux.winsize = undefined;
|
||||
return linux.syscall3(.ioctl, @bitCast(usize, @as(isize, handle)), linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0;
|
||||
return linux.ioctl(handle, linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0;
|
||||
}
|
||||
unreachable;
|
||||
}
|
||||
|
||||
@ -1186,11 +1186,11 @@ pub fn getrusage(who: i32, usage: *rusage) usize {
|
||||
}
|
||||
|
||||
pub fn tcgetattr(fd: fd_t, termios_p: *termios) usize {
|
||||
return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCGETS, @ptrToInt(termios_p));
|
||||
return ioctl(fd, TCGETS, @ptrToInt(termios_p));
|
||||
}
|
||||
|
||||
pub fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) usize {
|
||||
return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p));
|
||||
return ioctl(fd, TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p));
|
||||
}
|
||||
|
||||
pub fn ioctl(fd: fd_t, request: u32, arg: var) usize {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user