/* * Portable routines to get and set serial device attributes. * $Id$ * Copyright (c) 1997 by Tycho Softworks. * For conditions of distribution and reuse see product license. */ #include #ifndef TERMIOS_H_MISSING #include stty_t getstty(fd_t fd) { stty_t stty = (stty_t)malloc(sizeof(struct termios)); tcgetattr(fd, stty); return stty; } void putstty(fd_t fd, stty_t stty, bool now) { if(now) tcsetattr(fd, TCSANOW, stty); else tcsetattr(fd, TCSADRAIN, stty); free(stty); } #endif