authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-13 05:06:52-08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-02-13 05:06:52-08:00
logd7563a7753393d7f0d1af445276a64b8a55cb857
treeadd529c48653e4b4525fd2fe30e0ce2503c3d703
parent0c725a354a801c84100011db5eb53ae6c58086c9
parentce3bd515973c45ef755da04bc83585b7ce6b87b8
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #18910 from ziglang/std-termios

std.os.termios: consolidate, correct, and complete API definitions

11 files changed, 1098 insertions(+), 624 deletions(-)

lib/std/c.zig+788
......@@ -679,6 +679,794 @@ pub const MAP = switch (native_os) {
679679/// Used by libc to communicate failure. Not actually part of the underlying syscall.
680680pub const MAP_FAILED: *anyopaque = @ptrFromInt(std.math.maxInt(usize));
681681
682pub const cc_t = switch (native_os) {
683 .linux => std.os.linux.cc_t,
684 .macos, .ios, .tvos, .watchos, .netbsd, .openbsd => enum(u8) {
685 VEOF = 0,
686 VEOL = 1,
687 VEOL2 = 2,
688 VERASE = 3,
689 VWERASE = 4,
690 VKILL = 5,
691 VREPRINT = 6,
692 VINTR = 8,
693 VQUIT = 9,
694 VSUSP = 10,
695 VDSUSP = 11,
696 VSTART = 12,
697 VSTOP = 13,
698 VLNEXT = 14,
699 VDISCARD = 15,
700 VMIN = 16,
701 VTIME = 17,
702 VSTATUS = 18,
703 },
704 .freebsd, .kfreebsd => enum(u8) {
705 VEOF = 0,
706 VEOL = 1,
707 VEOL2 = 2,
708 VERASE = 3,
709 VWERASE = 4,
710 VKILL = 5,
711 VREPRINT = 6,
712 VERASE2 = 7,
713 VINTR = 8,
714 VQUIT = 9,
715 VSUSP = 10,
716 VDSUSP = 11,
717 VSTART = 12,
718 VSTOP = 13,
719 VLNEXT = 14,
720 VDISCARD = 15,
721 VMIN = 16,
722 VTIME = 17,
723 VSTATUS = 18,
724 },
725 .haiku => enum(u8) {
726 VINTR = 0,
727 VQUIT = 1,
728 VERASE = 2,
729 VKILL = 3,
730 VEOF = 4,
731 VEOL = 5,
732 VMIN = 4,
733 VTIME = 5,
734 VEOL2 = 6,
735 VSWTCH = 7,
736 VSTART = 8,
737 VSTOP = 9,
738 VSUSP = 10,
739 },
740 .solaris, .illumos => enum(u8) {
741 VINTR = 0,
742 VQUIT = 1,
743 VERASE = 2,
744 VKILL = 3,
745 VEOF = 4,
746 VEOL = 5,
747 VEOL2 = 6,
748 VMIN = 4,
749 VTIME = 5,
750 VSWTCH = 7,
751 VSTART = 8,
752 VSTOP = 9,
753 VSUSP = 10,
754 VDSUSP = 11,
755 VREPRINT = 12,
756 VDISCARD = 13,
757 VWERASE = 14,
758 VLNEXT = 15,
759 VSTATUS = 16,
760 VERASE2 = 17,
761 },
762 .emscripten, .wasi => enum(u8) {
763 VINTR = 0,
764 VQUIT = 1,
765 VERASE = 2,
766 VKILL = 3,
767 VEOF = 4,
768 VTIME = 5,
769 VMIN = 6,
770 VSWTC = 7,
771 VSTART = 8,
772 VSTOP = 9,
773 VSUSP = 10,
774 VEOL = 11,
775 VREPRINT = 12,
776 VDISCARD = 13,
777 VWERASE = 14,
778 VLNEXT = 15,
779 VEOL2 = 16,
780 },
781 else => @compileError("target libc does not have cc_t"),
782};
783
784pub const NCCS = switch (native_os) {
785 .linux => std.os.linux.NCCS,
786 .macos, .ios, .tvos, .watchos, .freebsd, .kfreebsd, .netbsd, .openbsd, .dragonfly => 20,
787 .haiku => 11,
788 .solaris, .illumos => 19,
789 .emscripten, .wasi => 32,
790 else => @compileError("target libc does not have NCCS"),
791};
792
793pub const termios = switch (native_os) {
794 .linux => std.os.linux.termios,
795 .macos, .ios, .tvos, .watchos => extern struct {
796 iflag: tc_iflag_t,
797 oflag: tc_oflag_t,
798 cflag: tc_cflag_t,
799 lflag: tc_lflag_t,
800 cc: [NCCS]cc_t,
801 ispeed: speed_t align(8),
802 ospeed: speed_t,
803 },
804 .freebsd, .kfreebsd, .netbsd, .dragonfly, .openbsd => extern struct {
805 iflag: tc_iflag_t,
806 oflag: tc_oflag_t,
807 cflag: tc_cflag_t,
808 lflag: tc_lflag_t,
809 cc: [NCCS]cc_t,
810 ispeed: speed_t,
811 ospeed: speed_t,
812 },
813 .haiku => extern struct {
814 iflag: tc_iflag_t,
815 oflag: tc_oflag_t,
816 cflag: tc_cflag_t,
817 lflag: tc_lflag_t,
818 line: cc_t,
819 ispeed: speed_t,
820 ospeed: speed_t,
821 cc: [NCCS]cc_t,
822 },
823 .solaris, .illumos => extern struct {
824 iflag: tc_iflag_t,
825 oflag: tc_oflag_t,
826 cflag: tc_cflag_t,
827 lflag: tc_lflag_t,
828 cc: [NCCS]cc_t,
829 },
830 .emscripten, .wasi => extern struct {
831 iflag: tc_iflag_t,
832 oflag: tc_oflag_t,
833 cflag: tc_cflag_t,
834 lflag: tc_lflag_t,
835 line: std.c.cc_t,
836 cc: [NCCS]cc_t,
837 ispeed: speed_t,
838 ospeed: speed_t,
839 },
840 else => @compileError("target libc does not have termios"),
841};
842
843pub const tc_iflag_t = switch (native_os) {
844 .linux => std.os.linux.tc_iflag_t,
845 .macos, .ios, .tvos, .watchos => packed struct(u32) {
846 IGNBRK: bool = false,
847 BRKINT: bool = false,
848 IGNPAR: bool = false,
849 PARMRK: bool = false,
850 INPCK: bool = false,
851 ISTRIP: bool = false,
852 INLCR: bool = false,
853 IGNCR: bool = false,
854 ICRNL: bool = false,
855 IXON: bool = false,
856 IXOFF: bool = false,
857 IXANY: bool = false,
858 _12: u1 = 0,
859 IMAXBEL: bool = false,
860 IUTF8: bool = false,
861 _: u17 = 0,
862 },
863 .netbsd, .freebsd, .kfreebsd, .dragonfly => packed struct(u32) {
864 IGNBRK: bool = false,
865 BRKINT: bool = false,
866 IGNPAR: bool = false,
867 PARMRK: bool = false,
868 INPCK: bool = false,
869 ISTRIP: bool = false,
870 INLCR: bool = false,
871 IGNCR: bool = false,
872 ICRNL: bool = false,
873 IXON: bool = false,
874 IXOFF: bool = false,
875 IXANY: bool = false,
876 _12: u1 = 0,
877 IMAXBEL: bool = false,
878 _: u18 = 0,
879 },
880 .openbsd => packed struct(u32) {
881 IGNBRK: bool = false,
882 BRKINT: bool = false,
883 IGNPAR: bool = false,
884 PARMRK: bool = false,
885 INPCK: bool = false,
886 ISTRIP: bool = false,
887 INLCR: bool = false,
888 IGNCR: bool = false,
889 ICRNL: bool = false,
890 IXON: bool = false,
891 IXOFF: bool = false,
892 IXANY: bool = false,
893 IUCLC: bool = false,
894 IMAXBEL: bool = false,
895 _: u18 = 0,
896 },
897 .haiku => packed struct(u32) {
898 IGNBRK: bool = false,
899 BRKINT: bool = false,
900 IGNPAR: bool = false,
901 PARMRK: bool = false,
902 INPCK: bool = false,
903 ISTRIP: bool = false,
904 INLCR: bool = false,
905 IGNCR: bool = false,
906 ICRNL: bool = false,
907 IUCLC: bool = false,
908 IXON: bool = false,
909 IXANY: bool = false,
910 IXOFF: bool = false,
911 _: u19 = 0,
912 },
913 .solaris, .illumos => packed struct(u32) {
914 IGNBRK: bool = false,
915 BRKINT: bool = false,
916 IGNPAR: bool = false,
917 PARMRK: bool = false,
918 INPCK: bool = false,
919 ISTRIP: bool = false,
920 INLCR: bool = false,
921 IGNCR: bool = false,
922 ICRNL: bool = false,
923 IUCLC: bool = false,
924 IXON: bool = false,
925 IXANY: bool = false,
926 _12: u1 = 0,
927 IMAXBEL: bool = false,
928 _14: u1 = 0,
929 DOSMODE: bool = false,
930 _: u16 = 0,
931 },
932 .emscripten, .wasi => packed struct(u32) {
933 IGNBRK: bool = false,
934 BRKINT: bool = false,
935 IGNPAR: bool = false,
936 PARMRK: bool = false,
937 INPCK: bool = false,
938 ISTRIP: bool = false,
939 INLCR: bool = false,
940 IGNCR: bool = false,
941 ICRNL: bool = false,
942 IUCLC: bool = false,
943 IXON: bool = false,
944 IXANY: bool = false,
945 IXOFF: bool = false,
946 IMAXBEL: bool = false,
947 IUTF8: bool = false,
948 _: u17 = 0,
949 },
950 else => @compileError("target libc does not have tc_iflag_t"),
951};
952
953pub const tc_oflag_t = switch (native_os) {
954 .linux => std.os.linux.tc_oflag_t,
955 .macos, .ios, .tvos, .watchos => packed struct(u32) {
956 OPOST: bool = false,
957 ONLCR: bool = false,
958 OXTABS: bool = false,
959 ONOEOT: bool = false,
960 OCRNL: bool = false,
961 ONOCR: bool = false,
962 ONLRET: bool = false,
963 OFILL: bool = false,
964 NLDLY: u2 = 0,
965 TABDLY: u2 = 0,
966 CRDLY: u2 = 0,
967 FFDLY: u1 = 0,
968 BSDLY: u1 = 0,
969 VTDLY: u1 = 0,
970 OFDEL: bool = false,
971 _: u14 = 0,
972 },
973 .netbsd => packed struct(u32) {
974 OPOST: bool = false,
975 ONLCR: bool = false,
976 OXTABS: bool = false,
977 ONOEOT: bool = false,
978 OCRNL: bool = false,
979 _5: u1 = 0,
980 ONOCR: bool = false,
981 ONLRET: bool = false,
982 _: u24 = 0,
983 },
984 .openbsd => packed struct(u32) {
985 OPOST: bool = false,
986 ONLCR: bool = false,
987 OXTABS: bool = false,
988 ONOEOT: bool = false,
989 OCRNL: bool = false,
990 OLCUC: bool = false,
991 ONOCR: bool = false,
992 ONLRET: bool = false,
993 _: u24 = 0,
994 },
995 .freebsd, .kfreebsd, .dragonfly => packed struct(u32) {
996 OPOST: bool = false,
997 ONLCR: bool = false,
998 _2: u1 = 0,
999 ONOEOT: bool = false,
1000 OCRNL: bool = false,
1001 ONOCR: bool = false,
1002 ONLRET: bool = false,
1003 _: u25 = 0,
1004 },
1005 .solaris, .illumos => packed struct(u32) {
1006 OPOST: bool = false,
1007 OLCUC: bool = false,
1008 ONLCR: bool = false,
1009 OCRNL: bool = false,
1010 ONOCR: bool = false,
1011 ONLRET: bool = false,
1012 OFILL: bool = false,
1013 OFDEL: bool = false,
1014 NLDLY: u1 = 0,
1015 CRDLY: u2 = 0,
1016 TABDLY: u2 = 0,
1017 BSDLY: u1 = 0,
1018 VTDLY: u1 = 0,
1019 FFDLY: u1 = 0,
1020 PAGEOUT: bool = false,
1021 WRAP: bool = false,
1022 _: u14 = 0,
1023 },
1024 .haiku, .wasi, .emscripten => packed struct(u32) {
1025 OPOST: bool = false,
1026 OLCUC: bool = false,
1027 ONLCR: bool = false,
1028 OCRNL: bool = false,
1029 ONOCR: bool = false,
1030 ONLRET: bool = false,
1031 OFILL: bool = false,
1032 OFDEL: bool = false,
1033 NLDLY: u1 = 0,
1034 CRDLY: u2 = 0,
1035 TABDLY: u2 = 0,
1036 BSDLY: u1 = 0,
1037 VTDLY: u1 = 0,
1038 FFDLY: u1 = 0,
1039 _: u16 = 0,
1040 },
1041 else => @compileError("target libc does not have tc_oflag_t"),
1042};
1043
1044pub const CSIZE = switch (native_os) {
1045 .linux => std.os.linux.CSIZE,
1046 .haiku => enum(u1) { CS7, CS8 },
1047 else => enum(u2) { CS5, CS6, CS7, CS8 },
1048};
1049
1050pub const tc_cflag_t = switch (native_os) {
1051 .linux => std.os.linux.tc_cflag_t,
1052 .macos, .ios, .tvos, .watchos => packed struct(u32) {
1053 CIGNORE: bool = false,
1054 _1: u5 = 0,
1055 CSTOPB: bool = false,
1056 _7: u1 = 0,
1057 CSIZE: CSIZE = .CS5,
1058 _10: u1 = 0,
1059 CREAD: bool = false,
1060 PARENB: bool = false,
1061 PARODD: bool = false,
1062 HUPCL: bool = false,
1063 CLOCAL: bool = false,
1064 CCTS_OFLOW: bool = false,
1065 CRTS_IFLOW: bool = false,
1066 CDTR_IFLOW: bool = false,
1067 CDSR_OFLOW: bool = false,
1068 CCAR_OFLOW: bool = false,
1069 _: u11 = 0,
1070 },
1071 .freebsd, .kfreebsd => packed struct(u32) {
1072 CIGNORE: bool = false,
1073 _1: u7 = 0,
1074 CSIZE: CSIZE = .CS5,
1075 CSTOPB: bool = false,
1076 CREAD: bool = false,
1077 PARENB: bool = false,
1078 PARODD: bool = false,
1079 HUPCL: bool = false,
1080 CLOCAL: bool = false,
1081 CCTS_OFLOW: bool = false,
1082 CRTS_IFLOW: bool = false,
1083 CDTR_IFLOW: bool = false,
1084 CDSR_OFLOW: bool = false,
1085 CCAR_OFLOW: bool = false,
1086 CNO_RTSDTR: bool = false,
1087 _: u10 = 0,
1088 },
1089 .netbsd => packed struct(u32) {
1090 CIGNORE: bool = false,
1091 _1: u7 = 0,
1092 CSIZE: CSIZE = .CS5,
1093 CSTOPB: bool = false,
1094 CREAD: bool = false,
1095 PARENB: bool = false,
1096 PARODD: bool = false,
1097 HUPCL: bool = false,
1098 CLOCAL: bool = false,
1099 CRTSCTS: bool = false,
1100 CDTRCTS: bool = false,
1101 _18: u2 = 0,
1102 MDMBUF: bool = false,
1103 _: u11 = 0,
1104 },
1105 .dragonfly => packed struct(u32) {
1106 CIGNORE: bool = false,
1107 _1: u7 = 0,
1108 CSIZE: CSIZE = .CS5,
1109 CSTOPB: bool = false,
1110 CREAD: bool = false,
1111 PARENB: bool = false,
1112 PARODD: bool = false,
1113 HUPCL: bool = false,
1114 CLOCAL: bool = false,
1115 CCTS_OFLOW: bool = false,
1116 CRTS_IFLOW: bool = false,
1117 CDTR_IFLOW: bool = false,
1118 CDSR_OFLOW: bool = false,
1119 CCAR_OFLOW: bool = false,
1120 _: u11 = 0,
1121 },
1122 .openbsd => packed struct(u32) {
1123 CIGNORE: bool = false,
1124 _1: u7 = 0,
1125 CSIZE: CSIZE = .CS5,
1126 CSTOPB: bool = false,
1127 CREAD: bool = false,
1128 PARENB: bool = false,
1129 PARODD: bool = false,
1130 HUPCL: bool = false,
1131 CLOCAL: bool = false,
1132 CRTSCTS: bool = false,
1133 _17: u3 = 0,
1134 MDMBUF: bool = false,
1135 _: u11 = 0,
1136 },
1137 .haiku => packed struct(u32) {
1138 _0: u5 = 0,
1139 CSIZE: CSIZE = .CS7,
1140 CSTOPB: bool = false,
1141 CREAD: bool = false,
1142 PARENB: bool = false,
1143 PARODD: bool = false,
1144 HUPCL: bool = false,
1145 CLOCAL: bool = false,
1146 XLOBLK: bool = false,
1147 CTSFLOW: bool = false,
1148 RTSFLOW: bool = false,
1149 _: u17 = 0,
1150 },
1151 .solaris, .illumos => packed struct(u32) {
1152 _0: u4 = 0,
1153 CSIZE: CSIZE = .CS5,
1154 CSTOPB: bool = false,
1155 CREAD: bool = false,
1156 PARENB: bool = false,
1157 PARODD: bool = false,
1158 HUPCL: bool = false,
1159 CLOCAL: bool = false,
1160 RCV1EN: bool = false,
1161 XMT1EN: bool = false,
1162 LOBLK: bool = false,
1163 XCLUDE: bool = false,
1164 _16: u4 = 0,
1165 PAREXT: bool = false,
1166 CBAUDEXT: bool = false,
1167 CIBAUDEXT: bool = false,
1168 _23: u7 = 0,
1169 CRTSXOFF: bool = false,
1170 CRTSCTS: bool = false,
1171 },
1172 .wasi, .emscripten => packed struct(u32) {
1173 _0: u4 = 0,
1174 CSIZE: CSIZE = .CS5,
1175 CSTOPB: bool = false,
1176 CREAD: bool = false,
1177 PARENB: bool = false,
1178 PARODD: bool = false,
1179 HUPCL: bool = false,
1180 CLOCAL: bool = false,
1181 _: u20 = 0,
1182 },
1183 else => @compileError("target libc does not have tc_cflag_t"),
1184};
1185
1186pub const tc_lflag_t = switch (native_os) {
1187 .linux => std.os.linux.tc_lflag_t,
1188 .macos, .ios, .tvos, .watchos, .netbsd, .freebsd, .kfreebsd, .dragonfly => packed struct(u32) {
1189 ECHOKE: bool = false,
1190 ECHOE: bool = false,
1191 ECHOK: bool = false,
1192 ECHO: bool = false,
1193 ECHONL: bool = false,
1194 ECHOPRT: bool = false,
1195 ECHOCTL: bool = false,
1196 ISIG: bool = false,
1197 ICANON: bool = false,
1198 ALTWERASE: bool = false,
1199 IEXTEN: bool = false,
1200 EXTPROC: bool = false,
1201 _12: u10 = 0,
1202 TOSTOP: bool = false,
1203 FLUSHO: bool = false,
1204 _24: u1 = 0,
1205 NOKERNINFO: bool = false,
1206 _26: u3 = 0,
1207 PENDIN: bool = false,
1208 _30: u1 = 0,
1209 NOFLSH: bool = false,
1210 },
1211 .openbsd => packed struct(u32) {
1212 ECHOKE: bool = false,
1213 ECHOE: bool = false,
1214 ECHOK: bool = false,
1215 ECHO: bool = false,
1216 ECHONL: bool = false,
1217 ECHOPRT: bool = false,
1218 ECHOCTL: bool = false,
1219 ISIG: bool = false,
1220 ICANON: bool = false,
1221 ALTWERASE: bool = false,
1222 IEXTEN: bool = false,
1223 EXTPROC: bool = false,
1224 _12: u10 = 0,
1225 TOSTOP: bool = false,
1226 FLUSHO: bool = false,
1227 XCASE: bool = false,
1228 NOKERNINFO: bool = false,
1229 _26: u3 = 0,
1230 PENDIN: bool = false,
1231 _30: u1 = 0,
1232 NOFLSH: bool = false,
1233 },
1234 .haiku => packed struct(u32) {
1235 ISIG: bool = false,
1236 ICANON: bool = false,
1237 XCASE: bool = false,
1238 ECHO: bool = false,
1239 ECHOE: bool = false,
1240 ECHOK: bool = false,
1241 ECHONL: bool = false,
1242 NOFLSH: bool = false,
1243 TOSTOP: bool = false,
1244 IEXTEN: bool = false,
1245 ECHOCTL: bool = false,
1246 ECHOPRT: bool = false,
1247 ECHOKE: bool = false,
1248 FLUSHO: bool = false,
1249 PENDIN: bool = false,
1250 _: u17 = 0,
1251 },
1252 .solaris, .illumos => packed struct(u32) {
1253 ISIG: bool = false,
1254 ICANON: bool = false,
1255 XCASE: bool = false,
1256 ECHO: bool = false,
1257 ECHOE: bool = false,
1258 ECHOK: bool = false,
1259 ECHONL: bool = false,
1260 NOFLSH: bool = false,
1261 TOSTOP: bool = false,
1262 ECHOCTL: bool = false,
1263 ECHOPRT: bool = false,
1264 ECHOKE: bool = false,
1265 DEFECHO: bool = false,
1266 FLUSHO: bool = false,
1267 PENDIN: bool = false,
1268 IEXTEN: bool = false,
1269 _: u16 = 0,
1270 },
1271 .wasi, .emscripten => packed struct(u32) {
1272 ISIG: bool = false,
1273 ICANON: bool = false,
1274 _2: u1 = 0,
1275 ECHO: bool = false,
1276 ECHOE: bool = false,
1277 ECHOK: bool = false,
1278 ECHONL: bool = false,
1279 NOFLSH: bool = false,
1280 TOSTOP: bool = false,
1281 _9: u6 = 0,
1282 IEXTEN: bool = false,
1283 _: u16 = 0,
1284 },
1285 else => @compileError("target libc does not have tc_lflag_t"),
1286};
1287
1288pub const speed_t = switch (native_os) {
1289 .linux => std.os.linux.speed_t,
1290 .macos, .ios, .tvos, .watchos, .openbsd => enum(u64) {
1291 B0 = 0,
1292 B50 = 50,
1293 B75 = 75,
1294 B110 = 110,
1295 B134 = 134,
1296 B150 = 150,
1297 B200 = 200,
1298 B300 = 300,
1299 B600 = 600,
1300 B1200 = 1200,
1301 B1800 = 1800,
1302 B2400 = 2400,
1303 B4800 = 4800,
1304 B9600 = 9600,
1305 B19200 = 19200,
1306 B38400 = 38400,
1307 B7200 = 7200,
1308 B14400 = 14400,
1309 B28800 = 28800,
1310 B57600 = 57600,
1311 B76800 = 76800,
1312 B115200 = 115200,
1313 B230400 = 230400,
1314 },
1315 .freebsd, .kfreebsd, .netbsd => enum(c_uint) {
1316 B0 = 0,
1317 B50 = 50,
1318 B75 = 75,
1319 B110 = 110,
1320 B134 = 134,
1321 B150 = 150,
1322 B200 = 200,
1323 B300 = 300,
1324 B600 = 600,
1325 B1200 = 1200,
1326 B1800 = 1800,
1327 B2400 = 2400,
1328 B4800 = 4800,
1329 B9600 = 9600,
1330 B19200 = 19200,
1331 B38400 = 38400,
1332 B7200 = 7200,
1333 B14400 = 14400,
1334 B28800 = 28800,
1335 B57600 = 57600,
1336 B76800 = 76800,
1337 B115200 = 115200,
1338 B230400 = 230400,
1339 B460800 = 460800,
1340 B500000 = 500000,
1341 B921600 = 921600,
1342 B1000000 = 1000000,
1343 B1500000 = 1500000,
1344 B2000000 = 2000000,
1345 B2500000 = 2500000,
1346 B3000000 = 3000000,
1347 B3500000 = 3500000,
1348 B4000000 = 4000000,
1349 },
1350 .dragonfly => enum(c_uint) {
1351 B0 = 0,
1352 B50 = 50,
1353 B75 = 75,
1354 B110 = 110,
1355 B134 = 134,
1356 B150 = 150,
1357 B200 = 200,
1358 B300 = 300,
1359 B600 = 600,
1360 B1200 = 1200,
1361 B1800 = 1800,
1362 B2400 = 2400,
1363 B4800 = 4800,
1364 B9600 = 9600,
1365 B19200 = 19200,
1366 B38400 = 38400,
1367 B7200 = 7200,
1368 B14400 = 14400,
1369 B28800 = 28800,
1370 B57600 = 57600,
1371 B76800 = 76800,
1372 B115200 = 115200,
1373 B230400 = 230400,
1374 B460800 = 460800,
1375 B921600 = 921600,
1376 },
1377 .haiku => enum(u8) {
1378 B0 = 0x00,
1379 B50 = 0x01,
1380 B75 = 0x02,
1381 B110 = 0x03,
1382 B134 = 0x04,
1383 B150 = 0x05,
1384 B200 = 0x06,
1385 B300 = 0x07,
1386 B600 = 0x08,
1387 B1200 = 0x09,
1388 B1800 = 0x0A,
1389 B2400 = 0x0B,
1390 B4800 = 0x0C,
1391 B9600 = 0x0D,
1392 B19200 = 0x0E,
1393 B38400 = 0x0F,
1394 B57600 = 0x10,
1395 B115200 = 0x11,
1396 B230400 = 0x12,
1397 B31250 = 0x13,
1398 },
1399 .solaris, .illumos => enum(c_uint) {
1400 B0 = 0,
1401 B50 = 1,
1402 B75 = 2,
1403 B110 = 3,
1404 B134 = 4,
1405 B150 = 5,
1406 B200 = 6,
1407 B300 = 7,
1408 B600 = 8,
1409 B1200 = 9,
1410 B1800 = 10,
1411 B2400 = 11,
1412 B4800 = 12,
1413 B9600 = 13,
1414 B19200 = 14,
1415 B38400 = 15,
1416 B57600 = 16,
1417 B76800 = 17,
1418 B115200 = 18,
1419 B153600 = 19,
1420 B230400 = 20,
1421 B307200 = 21,
1422 B460800 = 22,
1423 B921600 = 23,
1424 B1000000 = 24,
1425 B1152000 = 25,
1426 B1500000 = 26,
1427 B2000000 = 27,
1428 B2500000 = 28,
1429 B3000000 = 29,
1430 B3500000 = 30,
1431 B4000000 = 31,
1432 },
1433 .emscripten, .wasi => enum(u32) {
1434 B0 = 0o0000000,
1435 B50 = 0o0000001,
1436 B75 = 0o0000002,
1437 B110 = 0o0000003,
1438 B134 = 0o0000004,
1439 B150 = 0o0000005,
1440 B200 = 0o0000006,
1441 B300 = 0o0000007,
1442 B600 = 0o0000010,
1443 B1200 = 0o0000011,
1444 B1800 = 0o0000012,
1445 B2400 = 0o0000013,
1446 B4800 = 0o0000014,
1447 B9600 = 0o0000015,
1448 B19200 = 0o0000016,
1449 B38400 = 0o0000017,
1450
1451 B57600 = 0o0010001,
1452 B115200 = 0o0010002,
1453 B230400 = 0o0010003,
1454 B460800 = 0o0010004,
1455 B500000 = 0o0010005,
1456 B576000 = 0o0010006,
1457 B921600 = 0o0010007,
1458 B1000000 = 0o0010010,
1459 B1152000 = 0o0010011,
1460 B1500000 = 0o0010012,
1461 B2000000 = 0o0010013,
1462 B2500000 = 0o0010014,
1463 B3000000 = 0o0010015,
1464 B3500000 = 0o0010016,
1465 B4000000 = 0o0010017,
1466 },
1467 else => @compileError("target libc does not have speed_t"),
1468};
1469
6821470pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int;
6831471
6841472// Unix-like systems
lib/std/c/darwin.zig-165
......@@ -2692,127 +2692,6 @@ pub const SHUT = struct {
26922692 pub const RDWR = 2;
26932693};
26942694
2695// Term
2696pub const V = struct {
2697 pub const EOF = 0;
2698 pub const EOL = 1;
2699 pub const EOL2 = 2;
2700 pub const ERASE = 3;
2701 pub const WERASE = 4;
2702 pub const KILL = 5;
2703 pub const REPRINT = 6;
2704 pub const INTR = 8;
2705 pub const QUIT = 9;
2706 pub const SUSP = 10;
2707 pub const DSUSP = 11;
2708 pub const START = 12;
2709 pub const STOP = 13;
2710 pub const LNEXT = 14;
2711 pub const DISCARD = 15;
2712 pub const MIN = 16;
2713 pub const TIME = 17;
2714 pub const STATUS = 18;
2715};
2716
2717pub const NCCS = 20; // 2 spares (7, 19)
2718
2719pub const cc_t = u8;
2720pub const speed_t = u64;
2721pub const tcflag_t = u64;
2722
2723pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition
2724pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINTR
2725pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors
2726pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors
2727pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors
2728pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars
2729pub const INLCR: tcflag_t = 0x00000040; // map NL into CR
2730pub const IGNCR: tcflag_t = 0x00000080; // ignore CR
2731pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD)
2732pub const IXON: tcflag_t = 0x00000200; // enable output flow control
2733pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control
2734pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop
2735pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full
2736pub const IUTF8: tcflag_t = 0x00004000; // maintain state for UTF-8 VERASE
2737
2738pub const OPOST: tcflag_t = 0x00000001; //enable following output processing
2739pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD)
2740pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces
2741pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output)
2742
2743pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL on output
2744pub const ONOCR: tcflag_t = 0x00000020; // no CR output at column 0
2745pub const ONLRET: tcflag_t = 0x00000040; // NL performs CR function
2746pub const OFILL: tcflag_t = 0x00000080; // use fill characters for delay
2747pub const NLDLY: tcflag_t = 0x00000300; // \n delay
2748pub const TABDLY: tcflag_t = 0x00000c04; // horizontal tab delay
2749pub const CRDLY: tcflag_t = 0x00003000; // \r delay
2750pub const FFDLY: tcflag_t = 0x00004000; // form feed delay
2751pub const BSDLY: tcflag_t = 0x00008000; // \b delay
2752pub const VTDLY: tcflag_t = 0x00010000; // vertical tab delay
2753pub const OFDEL: tcflag_t = 0x00020000; // fill is DEL, else NUL
2754
2755pub const NL0: tcflag_t = 0x00000000;
2756pub const NL1: tcflag_t = 0x00000100;
2757pub const NL2: tcflag_t = 0x00000200;
2758pub const NL3: tcflag_t = 0x00000300;
2759pub const TAB0: tcflag_t = 0x00000000;
2760pub const TAB1: tcflag_t = 0x00000400;
2761pub const TAB2: tcflag_t = 0x00000800;
2762pub const TAB3: tcflag_t = 0x00000004;
2763pub const CR0: tcflag_t = 0x00000000;
2764pub const CR1: tcflag_t = 0x00001000;
2765pub const CR2: tcflag_t = 0x00002000;
2766pub const CR3: tcflag_t = 0x00003000;
2767pub const FF0: tcflag_t = 0x00000000;
2768pub const FF1: tcflag_t = 0x00004000;
2769pub const BS0: tcflag_t = 0x00000000;
2770pub const BS1: tcflag_t = 0x00008000;
2771pub const VT0: tcflag_t = 0x00000000;
2772pub const VT1: tcflag_t = 0x00010000;
2773
2774pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags
2775pub const CSIZE: tcflag_t = 0x00000300; // character size mask
2776pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo)
2777pub const CS6: tcflag_t = 0x00000100; // 6 bits
2778pub const CS7: tcflag_t = 0x00000200; // 7 bits
2779pub const CS8: tcflag_t = 0x00000300; // 8 bits
2780pub const CSTOPB: tcflag_t = 0x0000040; // send 2 stop bits
2781pub const CREAD: tcflag_t = 0x00000800; // enable receiver
2782pub const PARENB: tcflag_t = 0x00001000; // parity enable
2783pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even
2784pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close
2785pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines
2786pub const CCTS_OFLOW: tcflag_t = 0x00010000; // CTS flow control of output
2787pub const CRTSCTS: tcflag_t = (CCTS_OFLOW | CRTS_IFLOW);
2788pub const CRTS_IFLOW: tcflag_t = 0x00020000; // RTS flow control of input
2789pub const CDTR_IFLOW: tcflag_t = 0x00040000; // DTR flow control of input
2790pub const CDSR_OFLOW: tcflag_t = 0x00080000; // DSR flow control of output
2791pub const CCAR_OFLOW: tcflag_t = 0x00100000; // DCD flow control of output
2792pub const MDMBUF: tcflag_t = 0x00100000; // old name for CCAR_OFLOW
2793
2794pub const ECHOKE: tcflag_t = 0x00000001; // visual erase for line kill
2795pub const ECHOE: tcflag_t = 0x00000002; // visually erase chars
2796pub const ECHOK: tcflag_t = 0x00000004; // echo NL after line kill
2797pub const ECHO: tcflag_t = 0x00000008; // enable echoing
2798pub const ECHONL: tcflag_t = 0x00000010; // echo NL even if ECHO is off
2799pub const ECHOPRT: tcflag_t = 0x00000020; // visual erase mode for hardcopy
2800pub const ECHOCTL: tcflag_t = 0x00000040; // echo control chars as ^(Char)
2801pub const ISIG: tcflag_t = 0x00000080; // enable signals INTR, QUIT, [D]SUSP
2802pub const ICANON: tcflag_t = 0x00000100; // canonicalize input lines
2803pub const ALTWERASE: tcflag_t = 0x00000200; // use alternate WERASE algorithm
2804pub const IEXTEN: tcflag_t = 0x00000400; // enable DISCARD and LNEXT
2805pub const EXTPROC: tcflag_t = 0x00000800; // external processing
2806pub const TOSTOP: tcflag_t = 0x00400000; // stop background jobs from output
2807pub const FLUSHO: tcflag_t = 0x00800000; // output being flushed (state)
2808pub const NOKERNINFO: tcflag_t = 0x02000000; // no kernel output from VSTATUS
2809pub const PENDIN: tcflag_t = 0x20000000; // XXX retype pending input (state)
2810pub const NOFLSH: tcflag_t = 0x80000000; // don't flush after interrupt
2811
2812pub const TCSANOW: tcflag_t = 0; // make change immediate
2813pub const TCSADRAIN: tcflag_t = 1; // drain output, then change
2814pub const TCSAFLUSH: tcflag_t = 2; // drain output, flush input
2815pub const TCSASOFT: tcflag_t = 0x10; // flag - don't alter h.w. state
28162695pub const TCSA = enum(c_uint) {
28172696 NOW,
28182697 DRAIN,
......@@ -2820,50 +2699,6 @@ pub const TCSA = enum(c_uint) {
28202699 _,
28212700};
28222701
2823pub const B0: tcflag_t = 0;
2824pub const B50: tcflag_t = 50;
2825pub const B75: tcflag_t = 75;
2826pub const B110: tcflag_t = 110;
2827pub const B134: tcflag_t = 134;
2828pub const B150: tcflag_t = 150;
2829pub const B200: tcflag_t = 200;
2830pub const B300: tcflag_t = 300;
2831pub const B600: tcflag_t = 600;
2832pub const B1200: tcflag_t = 1200;
2833pub const B1800: tcflag_t = 1800;
2834pub const B2400: tcflag_t = 2400;
2835pub const B4800: tcflag_t = 4800;
2836pub const B9600: tcflag_t = 9600;
2837pub const B19200: tcflag_t = 19200;
2838pub const B38400: tcflag_t = 38400;
2839pub const B7200: tcflag_t = 7200;
2840pub const B14400: tcflag_t = 14400;
2841pub const B28800: tcflag_t = 28800;
2842pub const B57600: tcflag_t = 57600;
2843pub const B76800: tcflag_t = 76800;
2844pub const B115200: tcflag_t = 115200;
2845pub const B230400: tcflag_t = 230400;
2846pub const EXTA: tcflag_t = 19200;
2847pub const EXTB: tcflag_t = 38400;
2848
2849pub const TCIFLUSH: tcflag_t = 1;
2850pub const TCOFLUSH: tcflag_t = 2;
2851pub const TCIOFLUSH: tcflag_t = 3;
2852pub const TCOOFF: tcflag_t = 1;
2853pub const TCOON: tcflag_t = 2;
2854pub const TCIOFF: tcflag_t = 3;
2855pub const TCION: tcflag_t = 4;
2856
2857pub const termios = extern struct {
2858 iflag: tcflag_t, // input flags
2859 oflag: tcflag_t, // output flags
2860 cflag: tcflag_t, // control flags
2861 lflag: tcflag_t, // local flags
2862 cc: [NCCS]cc_t, // control chars
2863 ispeed: speed_t align(8), // input speed
2864 ospeed: speed_t, // output speed
2865};
2866
28672702pub const winsize = extern struct {
28682703 ws_row: u16,
28692704 ws_col: u16,
lib/std/c/emscripten.zig-2
......@@ -72,8 +72,6 @@ pub const sigset_t = emscripten.sigset_t;
7272pub const sockaddr = emscripten.sockaddr;
7373pub const socklen_t = emscripten.socklen_t;
7474pub const stack_t = emscripten.stack_t;
75pub const tcflag_t = emscripten.tcflag_t;
76pub const termios = emscripten.termios;
7775pub const time_t = emscripten.time_t;
7876pub const timespec = emscripten.timespec;
7977pub const timeval = emscripten.timeval;
lib/std/c/haiku.zig-17
......@@ -950,21 +950,4 @@ pub const directory_which = enum(c_int) {
950950 _,
951951};
952952
953pub const cc_t = u8;
954pub const speed_t = u8;
955pub const tcflag_t = u32;
956
957pub const NCCS = 11;
958
959pub const termios = extern struct {
960 c_iflag: tcflag_t,
961 c_oflag: tcflag_t,
962 c_cflag: tcflag_t,
963 c_lflag: tcflag_t,
964 c_line: cc_t,
965 c_ispeed: speed_t,
966 c_ospeed: speed_t,
967 cc_t: [NCCS]cc_t,
968};
969
970953pub const MSG_NOSIGNAL = 0x0800;
lib/std/c/linux.zig-2
......@@ -85,8 +85,6 @@ pub const sigset_t = linux.sigset_t;
8585pub const sockaddr = linux.sockaddr;
8686pub const socklen_t = linux.socklen_t;
8787pub const stack_t = linux.stack_t;
88pub const tcflag_t = linux.tcflag_t;
89pub const termios = linux.termios;
9088pub const time_t = linux.time_t;
9189pub const timespec = linux.timespec;
9290pub const timeval = linux.timeval;
lib/std/c/netbsd.zig-121
......@@ -806,90 +806,6 @@ pub const T = struct {
806806 pub const IOCXMTFRAME = 0x80087444;
807807};
808808
809// Term
810const V = struct {
811 pub const EOF = 0; // ICANON
812 pub const EOL = 1; // ICANON
813 pub const EOL2 = 2; // ICANON
814 pub const ERASE = 3; // ICANON
815 pub const WERASE = 4; // ICANON
816 pub const KILL = 5; // ICANON
817 pub const REPRINT = 6; // ICANON
818 // 7 spare 1
819 pub const INTR = 8; // ISIG
820 pub const QUIT = 9; // ISIG
821 pub const SUSP = 10; // ISIG
822 pub const DSUSP = 11; // ISIG
823 pub const START = 12; // IXON, IXOFF
824 pub const STOP = 13; // IXON, IXOFF
825 pub const LNEXT = 14; // IEXTEN
826 pub const DISCARD = 15; // IEXTEN
827 pub const MIN = 16; // !ICANON
828 pub const TIME = 17; // !ICANON
829 pub const STATUS = 18; // ICANON
830 // 19 spare 2
831};
832
833// Input flags - software input processing
834pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition
835pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINT
836pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors
837pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors
838pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors
839pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars
840pub const INLCR: tcflag_t = 0x00000040; // map NL into CR
841pub const IGNCR: tcflag_t = 0x00000080; // ignore CR
842pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD)
843pub const IXON: tcflag_t = 0x00000200; // enable output flow control
844pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control
845pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop
846pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full
847
848// Output flags - software output processing
849pub const OPOST: tcflag_t = 0x00000001; // enable following output processing
850pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD)
851pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces
852pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output
853pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL
854pub const ONOCR: tcflag_t = 0x00000040; // discard CR's when on column 0
855pub const ONLRET: tcflag_t = 0x00000080; // move to column 0 on CR
856
857// Control flags - hardware control of terminal
858pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags
859pub const CSIZE: tcflag_t = 0x00000300; // character size mask
860pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo)
861pub const CS6: tcflag_t = 0x00000100; // 6 bits
862pub const CS7: tcflag_t = 0x00000200; // 7 bits
863pub const CS8: tcflag_t = 0x00000300; // 8 bits
864pub const CSTOPB: tcflag_t = 0x00000400; // send 2 stop bits
865pub const CREAD: tcflag_t = 0x00000800; // enable receiver
866pub const PARENB: tcflag_t = 0x00001000; // parity enable
867pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even
868pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close
869pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines
870pub const CRTSCTS: tcflag_t = 0x00010000; // RTS/CTS full-duplex flow control
871pub const CRTS_IFLOW: tcflag_t = CRTSCTS; // XXX compat
872pub const CCTS_OFLOW: tcflag_t = CRTSCTS; // XXX compat
873pub const CDTRCTS: tcflag_t = 0x00020000; // DTR/CTS full-duplex flow control
874pub const MDMBUF: tcflag_t = 0x00100000; // DTR/DCD hardware flow control
875pub const CHWFLOW: tcflag_t = (MDMBUF | CRTSCTS | CDTRCTS); // all types of hw flow control
876
877pub const tcflag_t = c_uint;
878pub const speed_t = c_uint;
879pub const cc_t = u8;
880
881pub const NCCS = 20;
882
883pub const termios = extern struct {
884 iflag: tcflag_t, // input flags
885 oflag: tcflag_t, // output flags
886 cflag: tcflag_t, // control flags
887 lflag: tcflag_t, // local flags
888 cc: [NCCS]cc_t, // control chars
889 ispeed: c_int, // input speed
890 ospeed: c_int, // output speed
891};
892
893809// Commands passed to tcsetattr() for setting the termios structure.
894810pub const TCSA = struct {
895811 pub const NOW = 0; // make change immediate
......@@ -898,43 +814,6 @@ pub const TCSA = struct {
898814 pub const SOFT = 0x10; // flag - don't alter h.w. state
899815};
900816
901// Standard speeds
902pub const B0: c_uint = 0;
903pub const B50: c_uint = 50;
904pub const B75: c_uint = 75;
905pub const B110: c_uint = 110;
906pub const B134: c_uint = 134;
907pub const B150: c_uint = 150;
908pub const B200: c_uint = 200;
909pub const B300: c_uint = 300;
910pub const B600: c_uint = 600;
911pub const B1200: c_uint = 1200;
912pub const B1800: c_uint = 1800;
913pub const B2400: c_uint = 2400;
914pub const B4800: c_uint = 4800;
915pub const B9600: c_uint = 9600;
916pub const B19200: c_uint = 19200;
917pub const B38400: c_uint = 38400;
918pub const B7200: c_uint = 7200;
919pub const B14400: c_uint = 14400;
920pub const B28800: c_uint = 28800;
921pub const B57600: c_uint = 57600;
922pub const B76800: c_uint = 76800;
923pub const B115200: c_uint = 115200;
924pub const B230400: c_uint = 230400;
925pub const B460800: c_uint = 460800;
926pub const B500000: c_uint = 500000;
927pub const B921600: c_uint = 921600;
928pub const B1000000: c_uint = 1000000;
929pub const B1500000: c_uint = 1500000;
930pub const B2000000: c_uint = 2000000;
931pub const B2500000: c_uint = 2500000;
932pub const B3000000: c_uint = 3000000;
933pub const B3500000: c_uint = 3500000;
934pub const B4000000: c_uint = 4000000;
935pub const EXTA: c_uint = 19200;
936pub const EXTB: c_uint = 38400;
937
938817pub const TCIFLUSH = 1;
939818pub const TCOFLUSH = 2;
940819pub const TCIOFLUSH = 3;
lib/std/c/openbsd.zig-112
......@@ -768,91 +768,6 @@ pub const AUTH = struct {
768768 pub const ALLOW: c_int = (OKAY | ROOTOKAY | SECURE);
769769};
770770
771// Term
772pub const V = struct {
773 pub const EOF = 0; // ICANON
774 pub const EOL = 1; // ICANON
775 pub const EOL2 = 2; // ICANON
776 pub const ERASE = 3; // ICANON
777 pub const WERASE = 4; // ICANON
778 pub const KILL = 5; // ICANON
779 pub const REPRINT = 6; // ICANON
780 // 7 spare 1
781 pub const INTR = 8; // ISIG
782 pub const QUIT = 9; // ISIG
783 pub const SUSP = 10; // ISIG
784 pub const DSUSP = 11; // ISIG
785 pub const START = 12; // IXON, IXOFF
786 pub const STOP = 13; // IXON, IXOFF
787 pub const LNEXT = 14; // IEXTEN
788 pub const DISCARD = 15; // IEXTEN
789 pub const MIN = 16; // !ICANON
790 pub const TIME = 17; // !ICANON
791 pub const STATUS = 18; // ICANON
792 // 19 spare 2
793};
794
795pub const tcflag_t = c_uint;
796pub const speed_t = c_uint;
797pub const cc_t = u8;
798
799pub const NCCS = 20;
800
801// Input flags - software input processing
802pub const IGNBRK: tcflag_t = 0x00000001; // ignore BREAK condition
803pub const BRKINT: tcflag_t = 0x00000002; // map BREAK to SIGINT
804pub const IGNPAR: tcflag_t = 0x00000004; // ignore (discard) parity errors
805pub const PARMRK: tcflag_t = 0x00000008; // mark parity and framing errors
806pub const INPCK: tcflag_t = 0x00000010; // enable checking of parity errors
807pub const ISTRIP: tcflag_t = 0x00000020; // strip 8th bit off chars
808pub const INLCR: tcflag_t = 0x00000040; // map NL into CR
809pub const IGNCR: tcflag_t = 0x00000080; // ignore CR
810pub const ICRNL: tcflag_t = 0x00000100; // map CR to NL (ala CRMOD)
811pub const IXON: tcflag_t = 0x00000200; // enable output flow control
812pub const IXOFF: tcflag_t = 0x00000400; // enable input flow control
813pub const IXANY: tcflag_t = 0x00000800; // any char will restart after stop
814pub const IUCLC: tcflag_t = 0x00001000; // translate upper to lower case
815pub const IMAXBEL: tcflag_t = 0x00002000; // ring bell on input queue full
816
817// Output flags - software output processing
818pub const OPOST: tcflag_t = 0x00000001; // enable following output processing
819pub const ONLCR: tcflag_t = 0x00000002; // map NL to CR-NL (ala CRMOD)
820pub const OXTABS: tcflag_t = 0x00000004; // expand tabs to spaces
821pub const ONOEOT: tcflag_t = 0x00000008; // discard EOT's (^D) on output
822pub const OCRNL: tcflag_t = 0x00000010; // map CR to NL
823pub const OLCUC: tcflag_t = 0x00000020; // translate lower case to upper case
824pub const ONOCR: tcflag_t = 0x00000040; // No CR output at column 0
825pub const ONLRET: tcflag_t = 0x00000080; // NL performs the CR function
826
827// Control flags - hardware control of terminal
828pub const CIGNORE: tcflag_t = 0x00000001; // ignore control flags
829pub const CSIZE: tcflag_t = 0x00000300; // character size mask
830pub const CS5: tcflag_t = 0x00000000; // 5 bits (pseudo)
831pub const CS6: tcflag_t = 0x00000100; // 6 bits
832pub const CS7: tcflag_t = 0x00000200; // 7 bits
833pub const CS8: tcflag_t = 0x00000300; // 8 bits
834pub const CSTOPB: tcflag_t = 0x00000400; // send 2 stop bits
835pub const CREAD: tcflag_t = 0x00000800; // enable receiver
836pub const PARENB: tcflag_t = 0x00001000; // parity enable
837pub const PARODD: tcflag_t = 0x00002000; // odd parity, else even
838pub const HUPCL: tcflag_t = 0x00004000; // hang up on last close
839pub const CLOCAL: tcflag_t = 0x00008000; // ignore modem status lines
840pub const CRTSCTS: tcflag_t = 0x00010000; // RTS/CTS full-duplex flow control
841pub const CRTS_IFLOW: tcflag_t = CRTSCTS; // XXX compat
842pub const CCTS_OFLOW: tcflag_t = CRTSCTS; // XXX compat
843pub const MDMBUF: tcflag_t = 0x00100000; // DTR/DCD hardware flow control
844pub const CHWFLOW: tcflag_t = (MDMBUF | CRTSCTS); // all types of hw flow control
845
846pub const termios = extern struct {
847 iflag: tcflag_t, // input flags
848 oflag: tcflag_t, // output flags
849 cflag: tcflag_t, // control flags
850 lflag: tcflag_t, // local flags
851 cc: [NCCS]cc_t, // control chars
852 ispeed: c_int, // input speed
853 ospeed: c_int, // output speed
854};
855
856771// Commands passed to tcsetattr() for setting the termios structure.
857772pub const TCSA = struct {
858773 pub const NOW = 0; // make change immediate
......@@ -861,33 +776,6 @@ pub const TCSA = struct {
861776 pub const SOFT = 0x10; // flag - don't alter h.w. state
862777};
863778
864// Standard speeds
865pub const B0 = 0;
866pub const B50 = 50;
867pub const B75 = 75;
868pub const B110 = 110;
869pub const B134 = 134;
870pub const B150 = 150;
871pub const B200 = 200;
872pub const B300 = 300;
873pub const B600 = 600;
874pub const B1200 = 1200;
875pub const B1800 = 1800;
876pub const B2400 = 2400;
877pub const B4800 = 4800;
878pub const B9600 = 9600;
879pub const B19200 = 19200;
880pub const B38400 = 38400;
881pub const B7200 = 7200;
882pub const B14400 = 14400;
883pub const B28800 = 28800;
884pub const B57600 = 57600;
885pub const B76800 = 76800;
886pub const B115200 = 115200;
887pub const B230400 = 230400;
888pub const EXTA = 19200;
889pub const EXTB = 38400;
890
891779pub const TCIFLUSH = 1;
892780pub const TCOFLUSH = 2;
893781pub const TCIOFLUSH = 3;
lib/std/c/solaris.zig-14
......@@ -698,20 +698,6 @@ pub const SEEK = struct {
698698 pub const HOLE = 4;
699699};
700700
701pub const tcflag_t = c_uint;
702pub const cc_t = u8;
703pub const speed_t = c_uint;
704
705pub const NCCS = 19;
706
707pub const termios = extern struct {
708 c_iflag: tcflag_t,
709 c_oflag: tcflag_t,
710 c_cflag: tcflag_t,
711 c_lflag: tcflag_t,
712 c_cc: [NCCS]cc_t,
713};
714
715701fn tioc(t: u16, num: u8) u16 {
716702 return (t << 8) | num;
717703}
lib/std/os.zig+10-2
......@@ -139,6 +139,7 @@ pub const W = system.W;
139139pub const addrinfo = system.addrinfo;
140140pub const blkcnt_t = system.blkcnt_t;
141141pub const blksize_t = system.blksize_t;
142pub const cc_t = system.cc_t;
142143pub const clock_t = system.clock_t;
143144pub const cpu_set_t = system.cpu_set_t;
144145pub const dev_t = system.dev_t;
......@@ -172,8 +173,6 @@ pub const sigset_t = system.sigset_t;
172173pub const sockaddr = system.sockaddr;
173174pub const socklen_t = system.socklen_t;
174175pub const stack_t = system.stack_t;
175pub const tcflag_t = system.tcflag_t;
176pub const termios = system.termios;
177176pub const time_t = system.time_t;
178177pub const timespec = system.timespec;
179178pub const timestamp_t = system.timestamp_t;
......@@ -184,6 +183,15 @@ pub const uid_t = system.uid_t;
184183pub const user_desc = system.user_desc;
185184pub const utsname = system.utsname;
186185
186pub const termios = system.termios;
187pub const CSIZE = system.CSIZE;
188pub const NCCS = system.NCCS;
189pub const speed_t = system.speed_t;
190pub const tc_iflag_t = system.tc_iflag_t;
191pub const tc_oflag_t = system.tc_oflag_t;
192pub const tc_cflag_t = system.tc_cflag_t;
193pub const tc_lflag_t = system.tc_lflag_t;
194
187195pub const F_OK = system.F_OK;
188196pub const R_OK = system.R_OK;
189197pub const W_OK = system.W_OK;
lib/std/os/emscripten.zig-17
......@@ -1098,23 +1098,6 @@ pub const stack_t = extern struct {
10981098 size: usize,
10991099};
11001100
1101pub const cc_t = u8;
1102pub const speed_t = u32;
1103pub const tcflag_t = u32;
1104
1105pub const NCCS = 32;
1106
1107pub const termios = extern struct {
1108 iflag: tcflag_t,
1109 oflag: tcflag_t,
1110 cflag: tcflag_t,
1111 lflag: tcflag_t,
1112 line: cc_t,
1113 cc: [NCCS]cc_t,
1114 ispeed: speed_t,
1115 ospeed: speed_t,
1116};
1117
11181101pub const timespec = extern struct {
11191102 tv_sec: time_t,
11201103 tv_nsec: isize,
lib/std/os/linux.zig+300-172
......@@ -5004,175 +5004,291 @@ pub const rusage = extern struct {
50045004 pub const THREAD = 1;
50055005};
50065006
5007pub const cc_t = u8;
5008pub const speed_t = u32;
5009pub const tcflag_t = u32;
5010
5011pub const NCCS = 32;
5012
5013pub const B0 = 0o0000000;
5014pub const B50 = 0o0000001;
5015pub const B75 = 0o0000002;
5016pub const B110 = 0o0000003;
5017pub const B134 = 0o0000004;
5018pub const B150 = 0o0000005;
5019pub const B200 = 0o0000006;
5020pub const B300 = 0o0000007;
5021pub const B600 = 0o0000010;
5022pub const B1200 = 0o0000011;
5023pub const B1800 = 0o0000012;
5024pub const B2400 = 0o0000013;
5025pub const B4800 = 0o0000014;
5026pub const B9600 = 0o0000015;
5027pub const B19200 = 0o0000016;
5028pub const B38400 = 0o0000017;
5029pub const BOTHER = 0o0010000;
5030pub const B57600 = 0o0010001;
5031pub const B115200 = 0o0010002;
5032pub const B230400 = 0o0010003;
5033pub const B460800 = 0o0010004;
5034pub const B500000 = 0o0010005;
5035pub const B576000 = 0o0010006;
5036pub const B921600 = 0o0010007;
5037pub const B1000000 = 0o0010010;
5038pub const B1152000 = 0o0010011;
5039pub const B1500000 = 0o0010012;
5040pub const B2000000 = 0o0010013;
5041pub const B2500000 = 0o0010014;
5042pub const B3000000 = 0o0010015;
5043pub const B3500000 = 0o0010016;
5044pub const B4000000 = 0o0010017;
5045
5046pub const V = switch (native_arch) {
5047 .powerpc, .powerpc64, .powerpc64le => struct {
5048 pub const INTR = 0;
5049 pub const QUIT = 1;
5050 pub const ERASE = 2;
5051 pub const KILL = 3;
5052 pub const EOF = 4;
5053 pub const MIN = 5;
5054 pub const EOL = 6;
5055 pub const TIME = 7;
5056 pub const EOL2 = 8;
5057 pub const SWTC = 9;
5058 pub const WERASE = 10;
5059 pub const REPRINT = 11;
5060 pub const SUSP = 12;
5061 pub const START = 13;
5062 pub const STOP = 14;
5063 pub const LNEXT = 15;
5064 pub const DISCARD = 16;
5007pub const NCCS = switch (native_arch) {
5008 .powerpc, .powerpcle, .powerpc64, .powerpc64le => 19,
5009 else => 32,
5010};
5011
5012pub const speed_t = switch (native_arch) {
5013 .powerpc, .powerpcle, .powerpc64, .powerpc64le => enum(u32) {
5014 B0 = 0o0000000,
5015 B50 = 0o0000001,
5016 B75 = 0o0000002,
5017 B110 = 0o0000003,
5018 B134 = 0o0000004,
5019 B150 = 0o0000005,
5020 B200 = 0o0000006,
5021 B300 = 0o0000007,
5022 B600 = 0o0000010,
5023 B1200 = 0o0000011,
5024 B1800 = 0o0000012,
5025 B2400 = 0o0000013,
5026 B4800 = 0o0000014,
5027 B9600 = 0o0000015,
5028 B19200 = 0o0000016,
5029 B38400 = 0o0000017,
5030
5031 B57600 = 0o00020,
5032 B115200 = 0o00021,
5033 B230400 = 0o00022,
5034 B460800 = 0o00023,
5035 B500000 = 0o00024,
5036 B576000 = 0o00025,
5037 B921600 = 0o00026,
5038 B1000000 = 0o00027,
5039 B1152000 = 0o00030,
5040 B1500000 = 0o00031,
5041 B2000000 = 0o00032,
5042 B2500000 = 0o00033,
5043 B3000000 = 0o00034,
5044 B3500000 = 0o00035,
5045 B4000000 = 0o00036,
50655046 },
5066 .sparc, .sparc64 => struct {
5067 pub const INTR = 0;
5068 pub const QUIT = 1;
5069 pub const ERASE = 2;
5070 pub const KILL = 3;
5071 pub const EOF = 4;
5072 pub const EOL = 5;
5073 pub const EOL2 = 6;
5074 pub const SWTC = 7;
5075 pub const START = 8;
5076 pub const STOP = 9;
5077 pub const SUSP = 10;
5078 pub const DSUSP = 11;
5079 pub const REPRINT = 12;
5080 pub const DISCARD = 13;
5081 pub const WERASE = 14;
5082 pub const LNEXT = 15;
5083 pub const MIN = EOF;
5084 pub const TIME = EOL;
5047 else => enum(u32) {
5048 B0 = 0o0000000,
5049 B50 = 0o0000001,
5050 B75 = 0o0000002,
5051 B110 = 0o0000003,
5052 B134 = 0o0000004,
5053 B150 = 0o0000005,
5054 B200 = 0o0000006,
5055 B300 = 0o0000007,
5056 B600 = 0o0000010,
5057 B1200 = 0o0000011,
5058 B1800 = 0o0000012,
5059 B2400 = 0o0000013,
5060 B4800 = 0o0000014,
5061 B9600 = 0o0000015,
5062 B19200 = 0o0000016,
5063 B38400 = 0o0000017,
5064
5065 B57600 = 0o0010001,
5066 B115200 = 0o0010002,
5067 B230400 = 0o0010003,
5068 B460800 = 0o0010004,
5069 B500000 = 0o0010005,
5070 B576000 = 0o0010006,
5071 B921600 = 0o0010007,
5072 B1000000 = 0o0010010,
5073 B1152000 = 0o0010011,
5074 B1500000 = 0o0010012,
5075 B2000000 = 0o0010013,
5076 B2500000 = 0o0010014,
5077 B3000000 = 0o0010015,
5078 B3500000 = 0o0010016,
5079 B4000000 = 0o0010017,
50855080 },
5086 .mips, .mipsel, .mips64, .mips64el => struct {
5087 pub const INTR = 0;
5088 pub const QUIT = 1;
5089 pub const ERASE = 2;
5090 pub const KILL = 3;
5091 pub const MIN = 4;
5092 pub const TIME = 5;
5093 pub const EOL2 = 6;
5094 pub const SWTC = 7;
5095 pub const SWTCH = 7;
5096 pub const START = 8;
5097 pub const STOP = 9;
5098 pub const SUSP = 10;
5099 pub const REPRINT = 12;
5100 pub const DISCARD = 13;
5101 pub const WERASE = 14;
5102 pub const LNEXT = 15;
5103 pub const EOF = 16;
5104 pub const EOL = 17;
5081};
5082
5083pub const tc_iflag_t = switch (native_arch) {
5084 .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) {
5085 IGNBRK: bool = false,
5086 BRKINT: bool = false,
5087 IGNPAR: bool = false,
5088 PARMRK: bool = false,
5089 INPCK: bool = false,
5090 ISTRIP: bool = false,
5091 INLCR: bool = false,
5092 IGNCR: bool = false,
5093 ICRNL: bool = false,
5094 IXON: bool = false,
5095 IXOFF: bool = false,
5096 IXANY: bool = false,
5097 IUCLC: bool = false,
5098 IMAXBEL: bool = false,
5099 IUTF8: bool = false,
5100 _: u17 = 0,
51055101 },
5106 else => struct {
5107 pub const INTR = 0;
5108 pub const QUIT = 1;
5109 pub const ERASE = 2;
5110 pub const KILL = 3;
5111 pub const EOF = 4;
5112 pub const TIME = 5;
5113 pub const MIN = 6;
5114 pub const SWTC = 7;
5115 pub const START = 8;
5116 pub const STOP = 9;
5117 pub const SUSP = 10;
5118 pub const EOL = 11;
5119 pub const REPRINT = 12;
5120 pub const DISCARD = 13;
5121 pub const WERASE = 14;
5122 pub const LNEXT = 15;
5123 pub const EOL2 = 16;
5102 else => packed struct(u32) {
5103 IGNBRK: bool = false,
5104 BRKINT: bool = false,
5105 IGNPAR: bool = false,
5106 PARMRK: bool = false,
5107 INPCK: bool = false,
5108 ISTRIP: bool = false,
5109 INLCR: bool = false,
5110 IGNCR: bool = false,
5111 ICRNL: bool = false,
5112 IUCLC: bool = false,
5113 IXON: bool = false,
5114 IXANY: bool = false,
5115 IXOFF: bool = false,
5116 IMAXBEL: bool = false,
5117 IUTF8: bool = false,
5118 _: u17 = 0,
5119 },
5120};
5121
5122pub const tc_oflag_t = switch (native_arch) {
5123 .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) {
5124 OPOST: bool = false,
5125 ONLCR: bool = false,
5126 OLCUC: bool = false,
5127 OCRNL: bool = false,
5128 ONOCR: bool = false,
5129 ONLRET: bool = false,
5130 OFILL: bool = false,
5131 OFDEL: bool = false,
5132 NLDLY: u2 = 0,
5133 TABDLY: u2 = 0,
5134 CRDLY: u2 = 0,
5135 FFDLY: u1 = 0,
5136 BSDLY: u1 = 0,
5137 VTDLY: u1 = 0,
5138 _: u15 = 0,
5139 },
5140 else => packed struct(u32) {
5141 OPOST: bool = false,
5142 OLCUC: bool = false,
5143 ONLCR: bool = false,
5144 OCRNL: bool = false,
5145 ONOCR: bool = false,
5146 ONLRET: bool = false,
5147 OFILL: bool = false,
5148 OFDEL: bool = false,
5149 NLDLY: u1 = 0,
5150 CRDLY: u2 = 0,
5151 TABDLY: u2 = 0,
5152 BSDLY: u1 = 0,
5153 VTDLY: u1 = 0,
5154 FFDLY: u1 = 0,
5155 _: u16 = 0,
5156 },
5157};
5158
5159pub const CSIZE = enum(u2) { CS5, CS6, CS7, CS8 };
5160
5161pub const tc_cflag_t = switch (native_arch) {
5162 .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) {
5163 _0: u8 = 0,
5164 CSIZE: CSIZE = .CS5,
5165 CSTOPB: bool = false,
5166 CREAD: bool = false,
5167 PARENB: bool = false,
5168 PARODD: bool = false,
5169 HUPCL: bool = false,
5170 CLOCAL: bool = false,
5171 _: u16 = 0,
5172 },
5173 else => packed struct(u32) {
5174 _0: u4 = 0,
5175 CSIZE: CSIZE = .CS5,
5176 CSTOPB: bool = false,
5177 CREAD: bool = false,
5178 PARENB: bool = false,
5179 PARODD: bool = false,
5180 HUPCL: bool = false,
5181 CLOCAL: bool = false,
5182 _: u20 = 0,
51245183 },
51255184};
51265185
5127pub const IGNBRK: tcflag_t = 1;
5128pub const BRKINT: tcflag_t = 2;
5129pub const IGNPAR: tcflag_t = 4;
5130pub const PARMRK: tcflag_t = 8;
5131pub const INPCK: tcflag_t = 16;
5132pub const ISTRIP: tcflag_t = 32;
5133pub const INLCR: tcflag_t = 64;
5134pub const IGNCR: tcflag_t = 128;
5135pub const ICRNL: tcflag_t = 256;
5136pub const IUCLC: tcflag_t = 512;
5137pub const IXON: tcflag_t = 1024;
5138pub const IXANY: tcflag_t = 2048;
5139pub const IXOFF: tcflag_t = 4096;
5140pub const IMAXBEL: tcflag_t = 8192;
5141pub const IUTF8: tcflag_t = 16384;
5142
5143pub const OPOST: tcflag_t = 1;
5144pub const OLCUC: tcflag_t = 2;
5145pub const ONLCR: tcflag_t = 4;
5146pub const OCRNL: tcflag_t = 8;
5147pub const ONOCR: tcflag_t = 16;
5148pub const ONLRET: tcflag_t = 32;
5149pub const OFILL: tcflag_t = 64;
5150pub const OFDEL: tcflag_t = 128;
5151pub const VTDLY: tcflag_t = 16384;
5152pub const VT0: tcflag_t = 0;
5153pub const VT1: tcflag_t = 16384;
5154
5155pub const CSIZE: tcflag_t = 48;
5156pub const CS5: tcflag_t = 0;
5157pub const CS6: tcflag_t = 16;
5158pub const CS7: tcflag_t = 32;
5159pub const CS8: tcflag_t = 48;
5160pub const CSTOPB: tcflag_t = 64;
5161pub const CREAD: tcflag_t = 128;
5162pub const PARENB: tcflag_t = 256;
5163pub const PARODD: tcflag_t = 512;
5164pub const HUPCL: tcflag_t = 1024;
5165pub const CLOCAL: tcflag_t = 2048;
5166
5167pub const ISIG: tcflag_t = 1;
5168pub const ICANON: tcflag_t = 2;
5169pub const ECHO: tcflag_t = 8;
5170pub const ECHOE: tcflag_t = 16;
5171pub const ECHOK: tcflag_t = 32;
5172pub const ECHONL: tcflag_t = 64;
5173pub const NOFLSH: tcflag_t = 128;
5174pub const TOSTOP: tcflag_t = 256;
5175pub const IEXTEN: tcflag_t = 32768;
5186pub const tc_lflag_t = switch (native_arch) {
5187 .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) {
5188 _0: u1 = 0,
5189 ECHOE: bool = false,
5190 ECHOK: bool = false,
5191 ECHO: bool = false,
5192 ECHONL: bool = false,
5193 _5: u2 = 0,
5194 ISIG: bool = false,
5195 ICANON: bool = false,
5196 _9: u1 = 0,
5197 IEXTEN: bool = false,
5198 _11: u11 = 0,
5199 TOSTOP: bool = false,
5200 _23: u8 = 0,
5201 NOFLSH: bool = false,
5202 },
5203 .mips, .mipsel, .mips64, .mips64el => packed struct(u32) {
5204 ISIG: bool = false,
5205 ICANON: bool = false,
5206 _2: u1 = 0,
5207 ECHO: bool = false,
5208 ECHOE: bool = false,
5209 ECHOK: bool = false,
5210 ECHONL: bool = false,
5211 NOFLSH: bool = false,
5212 IEXTEN: bool = false,
5213 _9: u6 = 0,
5214 TOSTOP: bool = false,
5215 _: u16 = 0,
5216 },
5217 else => packed struct(u32) {
5218 ISIG: bool = false,
5219 ICANON: bool = false,
5220 _2: u1 = 0,
5221 ECHO: bool = false,
5222 ECHOE: bool = false,
5223 ECHOK: bool = false,
5224 ECHONL: bool = false,
5225 NOFLSH: bool = false,
5226 TOSTOP: bool = false,
5227 _9: u6 = 0,
5228 IEXTEN: bool = false,
5229 _: u16 = 0,
5230 },
5231};
5232
5233pub const cc_t = switch (native_arch) {
5234 .mips, .mipsel, .mips64, .mips64el => enum(u8) {
5235 VINTR = 0,
5236 VQUIT = 1,
5237 VERASE = 2,
5238 VKILL = 3,
5239 VMIN = 4,
5240 VTIME = 5,
5241 VEOL2 = 6,
5242 VSWTC = 7,
5243 VSTART = 8,
5244 VSTOP = 9,
5245 VSUSP = 10,
5246 VREPRINT = 12,
5247 VDISCARD = 13,
5248 VWERASE = 14,
5249 VLNEXT = 15,
5250 VEOF = 16,
5251 VEOL = 17,
5252 },
5253 .powerpc, .powerpcle, .powerpc64, .powerpc64le => enum(u8) {
5254 VINTR = 0,
5255 VQUIT = 1,
5256 VERASE = 2,
5257 VKILL = 3,
5258 VEOF = 4,
5259 VMIN = 5,
5260 VEOL = 6,
5261 VTIME = 7,
5262 VEOL2 = 8,
5263 VSWTC = 9,
5264 VWERASE = 10,
5265 VREPRINT = 11,
5266 VSUSP = 12,
5267 VSTART = 13,
5268 VSTOP = 14,
5269 VLNEXT = 15,
5270 VDISCARD = 16,
5271 },
5272 else => enum(u8) {
5273 VINTR = 0,
5274 VQUIT = 1,
5275 VERASE = 2,
5276 VKILL = 3,
5277 VEOF = 4,
5278 VTIME = 5,
5279 VMIN = 6,
5280 VSWTC = 7,
5281 VSTART = 8,
5282 VSTOP = 9,
5283 VSUSP = 10,
5284 VEOL = 11,
5285 VREPRINT = 12,
5286 VDISCARD = 13,
5287 VWERASE = 14,
5288 VLNEXT = 15,
5289 VEOL2 = 16,
5290 },
5291};
51765292
51775293pub const TCSA = enum(c_uint) {
51785294 NOW,
......@@ -5181,15 +5297,27 @@ pub const TCSA = enum(c_uint) {
51815297 _,
51825298};
51835299
5184pub const termios = extern struct {
5185 iflag: tcflag_t,
5186 oflag: tcflag_t,
5187 cflag: tcflag_t,
5188 lflag: tcflag_t,
5189 line: cc_t,
5190 cc: [NCCS]cc_t,
5191 ispeed: speed_t,
5192 ospeed: speed_t,
5300pub const termios = switch (native_arch) {
5301 .powerpc, .powerpcle, .powerpc64, .powerpc64le => extern struct {
5302 iflag: tc_iflag_t,
5303 oflag: tc_oflag_t,
5304 cflag: tc_cflag_t,
5305 lflag: tc_lflag_t,
5306 cc: [NCCS]cc_t,
5307 line: cc_t,
5308 ispeed: speed_t,
5309 ospeed: speed_t,
5310 },
5311 else => extern struct {
5312 iflag: tc_iflag_t,
5313 oflag: tc_oflag_t,
5314 cflag: tc_cflag_t,
5315 lflag: tc_lflag_t,
5316 line: cc_t,
5317 cc: [NCCS]cc_t,
5318 ispeed: speed_t,
5319 ospeed: speed_t,
5320 },
51935321};
51945322
51955323pub const SIOCGIFINDEX = 0x8933;