srctree

Andrew Kelley parent 9ec0cf23 5f925582
std.posix.termios: bring V back

In d7563a7753393d7f0d1af445276a64b8a55cb857, I misunderstood what cc_twas supposed to do. Those V enum values are indices into the array.

inlinesplit
lib/std/c.zig added: 158, removed: 153, total 5
@@ -679,104 +679,104 @@ pub const MAP = switch (native_os) {
/// Used by libc to communicate failure. Not actually part of the underlying syscall.
pub const MAP_FAILED: *anyopaque = @ptrFromInt(std.math.maxInt(usize));
 
pub const cc_t = switch (native_os) {
.linux => std.os.linux.cc_t,
.macos, .ios, .tvos, .watchos, .netbsd, .openbsd => enum(u8) {
VEOF = 0,
VEOL = 1,
VEOL2 = 2,
VERASE = 3,
VWERASE = 4,
VKILL = 5,
VREPRINT = 6,
VINTR = 8,
VQUIT = 9,
VSUSP = 10,
VDSUSP = 11,
VSTART = 12,
VSTOP = 13,
VLNEXT = 14,
VDISCARD = 15,
VMIN = 16,
VTIME = 17,
VSTATUS = 18,
pub const cc_t = u8;
 
/// Indices into the `cc` array in the `termios` struct.
pub const V = switch (native_os) {
.linux => std.os.linux.V,
.macos, .ios, .tvos, .watchos, .netbsd, .openbsd => enum {
EOF,
EOL,
EOL2,
ERASE,
WERASE,
KILL,
REPRINT,
reserved,
INTR,
QUIT,
SUSP,
DSUSP,
START,
STOP,
LNEXT,
DISCARD,
MIN,
TIME,
STATUS,
},
.freebsd, .kfreebsd => enum(u8) {
VEOF = 0,
VEOL = 1,
VEOL2 = 2,
VERASE = 3,
VWERASE = 4,
VKILL = 5,
VREPRINT = 6,
VERASE2 = 7,
VINTR = 8,
VQUIT = 9,
VSUSP = 10,
VDSUSP = 11,
VSTART = 12,
VSTOP = 13,
VLNEXT = 14,
VDISCARD = 15,
VMIN = 16,
VTIME = 17,
VSTATUS = 18,
.freebsd, .kfreebsd => enum {
EOF,
EOL,
EOL2,
ERASE,
WERASE,
KILL,
REPRINT,
ERASE2,
INTR,
QUIT,
SUSP,
DSUSP,
START,
STOP,
LNEXT,
DISCARD,
MIN,
TIME,
STATUS,
},
.haiku => enum(u8) {
VINTR = 0,
VQUIT = 1,
VERASE = 2,
VKILL = 3,
VEOF = 4,
VEOL = 5,
VMIN = 4,
VTIME = 5,
VEOL2 = 6,
VSWTCH = 7,
VSTART = 8,
VSTOP = 9,
VSUSP = 10,
.haiku => enum {
INTR,
QUIT,
ERASE,
KILL,
EOF,
EOL,
EOL2,
SWTCH,
START,
STOP,
SUSP,
},
.solaris, .illumos => enum(u8) {
VINTR = 0,
VQUIT = 1,
VERASE = 2,
VKILL = 3,
VEOF = 4,
VEOL = 5,
VEOL2 = 6,
VMIN = 4,
VTIME = 5,
VSWTCH = 7,
VSTART = 8,
VSTOP = 9,
VSUSP = 10,
VDSUSP = 11,
VREPRINT = 12,
VDISCARD = 13,
VWERASE = 14,
VLNEXT = 15,
VSTATUS = 16,
VERASE2 = 17,
.solaris, .illumos => enum {
INTR,
QUIT,
ERASE,
KILL,
EOF,
EOL,
EOL2,
SWTCH,
START,
STOP,
SUSP,
DSUSP,
REPRINT,
DISCARD,
WERASE,
LNEXT,
STATUS,
ERASE2,
},
.emscripten, .wasi => enum(u8) {
VINTR = 0,
VQUIT = 1,
VERASE = 2,
VKILL = 3,
VEOF = 4,
VTIME = 5,
VMIN = 6,
VSWTC = 7,
VSTART = 8,
VSTOP = 9,
VSUSP = 10,
VEOL = 11,
VREPRINT = 12,
VDISCARD = 13,
VWERASE = 14,
VLNEXT = 15,
VEOL2 = 16,
.emscripten, .wasi => enum {
INTR,
QUIT,
ERASE,
KILL,
EOF,
TIME,
MIN,
SWTC,
START,
STOP,
SUSP,
EOL,
REPRINT,
DISCARD,
WERASE,
LNEXT,
EOL2,
},
else => @compileError("target libc does not have cc_t"),
};
 
lib/std/os.zig added: 158, removed: 153, total 5
@@ -139,7 +139,6 @@ pub const W = system.W;
pub const addrinfo = system.addrinfo;
pub const blkcnt_t = system.blkcnt_t;
pub const blksize_t = system.blksize_t;
pub const cc_t = system.cc_t;
pub const clock_t = system.clock_t;
pub const cpu_set_t = system.cpu_set_t;
pub const dev_t = system.dev_t;
@@ -186,6 +185,8 @@ pub const utsname = system.utsname;
pub const termios = system.termios;
pub const CSIZE = system.CSIZE;
pub const NCCS = system.NCCS;
pub const cc_t = system.cc_t;
pub const V = system.V;
pub const speed_t = system.speed_t;
pub const tc_iflag_t = system.tc_iflag_t;
pub const tc_oflag_t = system.tc_oflag_t;
 
lib/std/os/linux.zig added: 158, removed: 153, total 5
@@ -5230,63 +5230,67 @@ pub const tc_lflag_t = switch (native_arch) {
},
};
 
pub const cc_t = switch (native_arch) {
.mips, .mipsel, .mips64, .mips64el => enum(u8) {
VINTR = 0,
VQUIT = 1,
VERASE = 2,
VKILL = 3,
VMIN = 4,
VTIME = 5,
VEOL2 = 6,
VSWTC = 7,
VSTART = 8,
VSTOP = 9,
VSUSP = 10,
VREPRINT = 12,
VDISCARD = 13,
VWERASE = 14,
VLNEXT = 15,
VEOF = 16,
VEOL = 17,
pub const cc_t = u8;
 
/// Indices into the `cc` array in the `termios` struct.
pub const V = switch (native_arch) {
.mips, .mipsel, .mips64, .mips64el => enum {
INTR,
QUIT,
ERASE,
KILL,
MIN,
TIME,
EOL2,
SWTC,
START,
STOP,
SUSP,
reserved,
REPRINT,
DISCARD,
WERASE,
LNEXT,
EOF,
EOL,
},
.powerpc, .powerpcle, .powerpc64, .powerpc64le => enum(u8) {
VINTR = 0,
VQUIT = 1,
VERASE = 2,
VKILL = 3,
VEOF = 4,
VMIN = 5,
VEOL = 6,
VTIME = 7,
VEOL2 = 8,
VSWTC = 9,
VWERASE = 10,
VREPRINT = 11,
VSUSP = 12,
VSTART = 13,
VSTOP = 14,
VLNEXT = 15,
VDISCARD = 16,
.powerpc, .powerpcle, .powerpc64, .powerpc64le => enum {
INTR,
QUIT,
ERASE,
KILL,
EOF,
MIN,
EOL,
TIME,
EOL2,
SWTC,
WERASE,
REPRINT,
SUSP,
START,
STOP,
LNEXT,
DISCARD,
},
else => enum(u8) {
VINTR = 0,
VQUIT = 1,
VERASE = 2,
VKILL = 3,
VEOF = 4,
VTIME = 5,
VMIN = 6,
VSWTC = 7,
VSTART = 8,
VSTOP = 9,
VSUSP = 10,
VEOL = 11,
VREPRINT = 12,
VDISCARD = 13,
VWERASE = 14,
VLNEXT = 15,
VEOL2 = 16,
else => enum {
INTR,
QUIT,
ERASE,
KILL,
EOF,
TIME,
MIN,
SWTC,
START,
STOP,
SUSP,
EOL,
REPRINT,
DISCARD,
WERASE,
LNEXT,
EOL2,
},
};