#include #include char * getpass(str) char *str; { static char buf[80]; struct sgttyb oldsb, newsb; gtty(0, &oldsb); newsb = oldsb; newsb.sg_flags &= ~ECHO; stty(0, &newsb); fputs(str, stderr); fflush(stderr); buf[0] = 0; fgets(buf, 80, stdin); stty(0, &oldsb); return buf; }