Skip to content

Commit 2ff64c7

Browse files
committed
std.os.termios: add/fix std.c.TCSA for BSDs
1 parent 50cdb75 commit 2ff64c7

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

lib/std/c/dragonfly.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,13 @@ pub const NOTE_FFCTRLMASK = 3221225472;
557557
pub const NOTE_FFCOPY = 3221225472;
558558
pub const NOTE_PCTRLMASK = 4026531840;
559559

560+
pub const TCSA = enum(c_uint) {
561+
NOW,
562+
DRAIN,
563+
FLUSH,
564+
_,
565+
};
566+
560567
pub const stack_t = extern struct {
561568
sp: [*]u8,
562569
size: isize,

lib/std/c/freebsd.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,13 @@ pub const T = struct {
11531153
pub const IOCSIG = 0x2004745f;
11541154
};
11551155

1156+
pub const TCSA = enum(c_uint) {
1157+
NOW,
1158+
DRAIN,
1159+
FLUSH,
1160+
_,
1161+
};
1162+
11561163
pub const winsize = extern struct {
11571164
ws_row: u16,
11581165
ws_col: u16,

lib/std/c/netbsd.zig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -806,12 +806,11 @@ pub const T = struct {
806806
pub const IOCXMTFRAME = 0x80087444;
807807
};
808808

809-
// Commands passed to tcsetattr() for setting the termios structure.
810-
pub const TCSA = struct {
811-
pub const NOW = 0; // make change immediate
812-
pub const DRAIN = 1; // drain output, then chage
813-
pub const FLUSH = 2; // drain output, flush input
814-
pub const SOFT = 0x10; // flag - don't alter h.w. state
809+
pub const TCSA = enum(c_uint) {
810+
NOW,
811+
DRAIN,
812+
FLUSH,
813+
_,
815814
};
816815

817816
pub const TCIFLUSH = 1;

lib/std/c/openbsd.zig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,11 @@ pub const AUTH = struct {
768768
pub const ALLOW: c_int = (OKAY | ROOTOKAY | SECURE);
769769
};
770770

771-
// Commands passed to tcsetattr() for setting the termios structure.
772-
pub const TCSA = struct {
773-
pub const NOW = 0; // make change immediate
774-
pub const DRAIN = 1; // drain output, then change
775-
pub const FLUSH = 2; // drain output, flush input
776-
pub const SOFT = 0x10; // flag - don't alter h.w. state
771+
pub const TCSA = enum(c_uint) {
772+
NOW,
773+
DRAIN,
774+
FLUSH,
775+
_,
777776
};
778777

779778
pub const TCIFLUSH = 1;

0 commit comments

Comments
 (0)