Revision 13401ba0 util/oslib-posix.c

b/util/oslib-posix.c
47 47
#  define QEMU_VMALLOC_ALIGN getpagesize()
48 48
#endif
49 49

  
50
#include <termios.h>
51
#include <unistd.h>
52

  
50 53
#include <glib/gprintf.h>
51 54

  
52 55
#include "config-host.h"
......
251 254
    return g_strdup_printf("%s/%s", CONFIG_QEMU_LOCALSTATEDIR,
252 255
                           relative_pathname);
253 256
}
257

  
258
void qemu_set_tty_echo(int fd, bool echo)
259
{
260
    struct termios tty;
261

  
262
    tcgetattr(fd, &tty);
263

  
264
    if (echo) {
265
        tty.c_lflag |= ECHO | ECHONL | ICANON | IEXTEN;
266
    } else {
267
        tty.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN);
268
    }
269

  
270
    tcsetattr(fd, TCSANOW, &tty);
271
}

Also available in: Unified diff