Index: pam-1.5.3/examples/tty_conv.c =================================================================== --- pam-1.5.3.orig/examples/tty_conv.c +++ pam-1.5.3/examples/tty_conv.c @@ -6,7 +6,12 @@ #include #include #include +#ifndef __GNU__ #include +#else +#include +#include +#endif #include /*************************************** @@ -16,6 +21,7 @@ ***************************************/ static void echoOff(int fd, int off) { +#ifndef __GNU__ struct termio tty; if (ioctl(fd, TCGETA, &tty) < 0) { @@ -39,6 +45,31 @@ static void echoOff(int fd, int off) fprintf(stderr, "TCSETAW failed: %s\n", strerror(errno)); } } +#else + struct termios tty; + if (ioctl(fd, TIOCGETA, &tty) < 0) + { + fprintf(stderr, "TIOCGETA failed: %s\n", strerror(errno)); + return; + } + + if (off) + { + tty.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); + if (ioctl(fd, TIOCSETAF, &tty) < 0) + { + fprintf(stderr, "TIOCSETAF failed: %s\n", strerror(errno)); + } + } + else + { + tty.c_lflag |= (ECHO | ECHOE | ECHOK | ECHONL); + if (ioctl(fd, TIOCSETAW, &tty) < 0) + { + fprintf(stderr, "TIOCSETAW failed: %s\n", strerror(errno)); + } + } +#endif } /***************************************