authorgravatar for git@l4.pmLuna <git@l4.pm> 2020-04-20 17:16:52-03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-06-02 14:56:19-04:00
log7c710542867d283b6ab774af76083d55996b127e
tree38c1ed0fce06df30f3c7e6b6183f167f89f7c205
parent09c01ea7b9a8d80f3ad0eec1e20303996fdcba9b

Replace syscall3 to os.ioctl


2 files changed, 3 insertions(+), 3 deletions(-)

lib/std/os.zig+1-1
...@@ -2391,7 +2391,7 @@ pub fn isatty(handle: fd_t) bool {...@@ -2391,7 +2391,7 @@ pub fn isatty(handle: fd_t) bool {
2391 }2391 }
2392 if (builtin.os.tag == .linux) {2392 if (builtin.os.tag == .linux) {
2393 var wsz: linux.winsize = undefined;2393 var wsz: linux.winsize = undefined;
2394 return linux.syscall3(.ioctl, @bitCast(usize, @as(isize, handle)), linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0;2394 return linux.ioctl(handle, linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0;
2395 }2395 }
2396 unreachable;2396 unreachable;
2397}2397}
lib/std/os/linux.zig+2-2
...@@ -1186,11 +1186,11 @@ pub fn getrusage(who: i32, usage: *rusage) usize {...@@ -1186,11 +1186,11 @@ pub fn getrusage(who: i32, usage: *rusage) usize {
1186}1186}
11871187
1188pub fn tcgetattr(fd: fd_t, termios_p: *termios) usize {1188pub fn tcgetattr(fd: fd_t, termios_p: *termios) usize {
1189 return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCGETS, @ptrToInt(termios_p));1189 return ioctl(fd, TCGETS, @ptrToInt(termios_p));
1190}1190}
11911191
1192pub fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) usize {1192pub fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) usize {
1193 return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p));1193 return ioctl(fd, TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p));
1194}1194}
11951195
1196pub fn ioctl(fd: fd_t, request: u32, arg: var) usize {1196pub fn ioctl(fd: fd_t, request: u32, arg: var) usize {