2 % (c) The GRASP/AQUA Project, Glasgow University, 1998
4 \subsection[echoAux.lc]{Support functions for changing echoing}
11 #ifdef HAVE_SYS_TYPES_H
12 #include <sys/types.h>
15 #ifdef HAVE_SYS_STAT_H
28 setTerminalEcho(fp, on)
35 while ( (fd = fileno((FILE*)fp)) < 0) {
42 while ( (rc = tcgetattr(fd,&tios)) == -1) {
53 tios.c_lflag &= ~ECHO;
56 while ( (rc = tcsetattr(fd,TCSANOW,&tios)) == -1) {
73 while ( (fd = fileno((FILE*)fp)) < 0) {
80 while ( (rc = tcgetattr(fd,&tios)) == -1) {
87 return (tios.c_cflag & ECHO ? 1 : 0);
97 while ( (fd = fileno((FILE*)fp)) < 0) {
104 while ( (rc = tcgetattr(fd,&tios)) == -1) {
105 if (errno == ENOTTY) return 0;
106 if (errno != EINTR) {