|
#include <pwd.h>
#include <sys/types.h>
main()
{
struct passwd *user;
while((user=getpwent())!=0)
{
printf("%s: %d: %d: %s: %s: %s\n", user->pw_name, user->pw_uid, user->pw_gid, user->pw_gecos, user->pw_dir, user->pw_shell);
}
endpwent();
}
这个getpwent在pwd.h里定义的 但是具体连接到什么库上啊 好像不光是libcrypt啊
还有像getpwent这样的在/usr/include里头文件定义的函数,函数体在哪里能看见源代码
是不是只能找安装时的发行包啊,
上面的程序在LFS6.2里编译
gcc -o pwd pwd.c -lcrypt
好像不能通过啊 要怎么编译多谢了 |
|