Commit 7c71054286

Luna <git@l4.pm>
2020-04-20 22:16:52
Replace syscall3 to os.ioctl
1 parent 09c01ea
Changed files (2)
lib
lib/std/os/linux.zig
@@ -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 {
lib/std/os.zig
@@ -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;
 }