问题描述
#include <unistd.h>
#include <stdio.h>
int main() {
char *password = getpass("Password: ");
puts(password);
return 0;
}
我发现 getpass 无法从标准输入中获取输入。
$ ./getpass <<< abc
Password:
xxx
看来这和termios有关。有人能告诉我与这个程序等效的底层代码是如何完成的吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)