termios.h says there are 17 characters (0..16) in the c_cc buffer. If I print them all out (here I've run it three times), it seems like 4 characters change their value between calls: 8 (VSTART) 9 (VSTOP) 10 (VSUSP) 16 (VEOL2)
0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8: 18 9:122 10:99 11:255 12:127 13:0 14:0 15:0 16:134 0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8:215 9:152 10:145 11:255 12:127 13:0 14:0 15:0 16:129 0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8: 10 9:97 10:251 11:255 12:127 13:0 14:0 15:0 16:239
I'll upload this program as termio2.c.
Finally the equivalent function from termios, namely tcgetattr, seems to give the right results, consistently over calls:
0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8:17 9:19 10:26 11:255 12:18 13:15 14:23 15:22 16:255
I'll upload this as termio3.c
termios.h says there are 17 characters (0..16) in the c_cc buffer. If I print them all out (here I've run it three times), it seems like 4 characters change their value between calls: 8 (VSTART) 9 (VSTOP) 10 (VSUSP) 16 (VEOL2)
0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8: 18 9:122 10:99 11:255 12:127 13:0 14:0 15:0 16:134
0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8:215 9:152 10:145 11:255 12:127 13:0 14:0 15:0 16:129
0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8: 10 9:97 10:251 11:255 12:127 13:0 14:0 15:0 16:239
I'll upload this program as termio2.c.
Finally the equivalent function from termios, namely tcgetattr, seems to give the right results, consistently over calls:
0:3 1:28 2:127 3:21 4:4 5:0 6:1 7:255 8:17 9:19 10:26 11:255 12:18 13:15 14:23 15:22 16:255
I'll upload this as termio3.c