        #include <sgtty.h>

        echo_off()
        {
          struct sgttyb state;
          (void)ioctl(0, (int)TIOCGETP, (char *)&state);
          state.sg_flags &= ~ECHO;
          (void)ioctl(0, (int)TIOCSETP, (char *)&state);
        }

        echo_on()
        {
          struct sgttyb state;
          (void)ioctl(0, (int)TIOCGETP, (char *)&state);
          state.sg_flags |= ECHO;
          (void)ioctl(0, (int)TIOCSETP, (char *)&state);
        }
