2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: echoAux.c,v 1.5 2001/02/19 16:07:48 rrt Exp $
6 * Support functions for changing echoing
12 #ifdef HAVE_SYS_TYPES_H
13 #include <sys/types.h>
16 #ifdef HAVE_SYS_STAT_H
29 setTerminalEcho(StgForeignPtr ptr, StgInt on)
31 #ifndef mingw32_TARGET_OS
32 IOFileObject* fo = (IOFileObject*)ptr;
38 while ( (rc = tcgetattr(fd,&tios)) == -1) {
49 tios.c_lflag &= ~ECHO;
52 while ( (rc = tcSetAttr(fd,TCSANOW,&tios)) == -1) {
64 getTerminalEcho(StgForeignPtr ptr)
66 #ifndef mingw32_TARGET_OS
67 IOFileObject* fo = (IOFileObject*)ptr;
73 while ( (rc = tcgetattr(fd,&tios)) == -1) {
80 return (tios.c_cflag & ECHO ? 1 : 0);
87 isTerminalDevice(StgForeignPtr ptr)
89 #ifndef mingw32_TARGET_OS
90 IOFileObject* fo = (IOFileObject*)ptr;
96 while ( (rc = tcgetattr(fd,&tios)) == -1) {
97 if (errno == ENOTTY) return 0;