I heard you might be able to just do this like so:
ostream dev("tty.mydevice");
dev < "hi";
So, why do we need termios. In other words, what's the purpose of the code in this question?
termios
provides functionality specific to serial ports and terminals which isn't available through standard I/O. For example, it allows for:
^C
, ^Z
, etc)