|
��������
getpwent, getpwuid, getpwnam, setpwent, endpwent,
fgetpwent - ��������� ��������� ����� �������
���������
#include <pwd.h> struct passwd *getpwent ( ) struct passwd *getpwuid (uid) int uid; struct passwd *getpwnam (name) char *name; void setpwent ( ) void endpwent ( ) struct passwd *fgetpwent (f) FILE *f;
��������
������ �� ������� getpwent, getpwuid � getpwnam ���������� ��������� �� ��������� ���� passwd, ����������
����������� �� ���� ������ ����� ������� /etc/passwd.
��������� ������� �� ���������� ����� <pwd.h>:
struct passwd { char *pw_name; char *pw_passwd; int pw_uid; int pw_gid; char *pw_age; char *pw_comment; char *pw_gecos; char *pw_dir; char *pw_shell; };�� ������ ������ ����� ��������� ��. passwd(4).
��� ������ ������ ������� getpwent ���������� ��������� �� ������ ��������� ���� passwd � �����; ��� ��������� ������ ������������ ��������� �� ��������� ���������; ������� ���������������� ������ ������� ����� ������������ ��� ��������� ����� �����. ������� getpwuid ���� � ������ ����� ������, ���������� �������� ������������� ������������ uid, � ���������� ��������� �� ���������, ��������������� ������� ������. ������� getpwnam ���� � ������ ����� ������, ���������� ����������������� ������� ��� name � ���������� ��������� �� ��������������� ���������. � ������ ���������� ������ (� ��� ����� �� �� ������ ������) ��������� ������� ���������� ������ ��������� NULL.
����� ������� setpwent �������� � ������������� ��������� ������ �� ������ ����� �������, �� ���� ����� ����� ������ ����� ����� ��������� �������� ����� �����. ������� endpwent ������ ��� �������� ����� �������.
������� fgetpwent ���������� ��������� �� ��������� ��������� ���� passwd � ������ f, ��������������� ������� ����� /etc/passwd.
�����
/etc/passwd
��. �����
getlogin(3C), getgrent(3C), passwd(4).
�����������
� ������ ���������� ������ (� ��� ����� �� �� ������
������) ������������ ������ ��������� NULL.
���������������
��������� ������� ���������� ����������� ����� �����/
������, ��� �������� � ������������ ���������� �������
��������, �� ������������ ����������� ����/�����.
�����������
��������, ������������ ���������� ���������, ���������
�� ���� � ��� �� ����������� ������, ���������� �������� ��������� ���������� ����� ������� ������. �������,
���� ���������� ��������� ���������� � ������� �������
����������, ������� ����������� ��.
|