void init_metex(int fd){ int status; struct termios term; // crea variabile di tipo termios term.c_oflag = 0; // ...ne assegna i membri term.c_lflag = 0; term.c_iflag = IGNBRK | IGNPAR; term.c_cflag = CREAD | CLOCAL | ...; cfsetispeed(&term,....); cfsetospeed(&term,....); tcsetattr(fd,TCSANOW,&term); // assegna la struttura al file ioctl(fd,TIOCMGET,&status); // chiede stato linee di controllo status &= ~TIOCM_RTS; ioctl(fd,TIOCMSET,&status); // setta stato linee di controllo }