diff options
| author | nofmal <ariaoverskies@gmail.com> | 2020-01-30 13:36:28 +0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-02-04 14:09:57 -0500 |
| commit | a697de3eac7fb4bb09e7f2aaee18c916a4eacc07 (patch) | |
| tree | 9a1829e3af21524d5ec957fdbeb80fc27bc3257c /lib/std/os/linux.zig | |
| parent | 0fdcd5c4cb335fcb2d637b891e60094b7a34e2b5 (diff) | |
| download | zig-a697de3eac7fb4bb09e7f2aaee18c916a4eacc07.tar.gz zig-a697de3eac7fb4bb09e7f2aaee18c916a4eacc07.zip | |
Add basic linux termios implementation
Diffstat (limited to 'lib/std/os/linux.zig')
| -rw-r--r-- | lib/std/os/linux.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 5c25b4369c..d11f206482 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -1061,6 +1061,14 @@ pub fn getrusage(who: i32, usage: *rusage) usize { return syscall2(SYS_getrusage, @bitCast(usize, @as(isize, who)), @ptrToInt(usage)); } +pub fn tcgetattr(fd: fd_t, termios_p: *termios) usize { + return syscall3(SYS_ioctl, @bitCast(usize, @as(isize, fd)), TCGETS, @ptrToInt(termios_p)); +} + +pub fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) usize { + return syscall3(SYS_ioctl, @bitCast(usize, @as(isize, fd)), TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p)); +} + test "" { if (builtin.os == .linux) { _ = @import("linux/test.zig"); |
