Support platforms without fcntl/termios/tty