#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <termio.h>
int getPasswd(char *passwd)
{
struct termio tbuf_old,tbuf;
ioctl(0, TCGETA, &tbuf_old);
ioctl(0, TCGETA, &tbuf);
tbuf.c_lflag &=~ECHO;
if (ioctl(0, TCSETAF, &tbuf) != 0)
return;
printf( "please input passwd: ");
scanf( "%s ", passwd);
ioctl(0, TCSETAF, &tbuf_old);
return 0;
};
int main()
{
char passwd[8];
getPasswd( passwd );
printf( "pass: %s\n ", passwd);
return 1;
}